
#14951: SpecContsr needs two runs when one should suffice -------------------------------------+------------------------------------- Reporter: nomeata | Owner: (none) Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: SpecConstr Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #14844 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by sgraf): Indeed we can only add `t ↦ ScrutOcc` if we know that a matching specialisation will apply. Consider what would happen if we regarded `(n-1)` as a constructor form (it isn't , of course, but imagine inductive nats), too: Then we would have `[ScrutOcc [UnkOcc], ScrutOcc [UnkOcc, UnkOcc]` for `l`s RHS and would have a more specific specialisation for `l (n-1) (x,y)`. If we bubble out a usage of `t ↦ ScrutOcc` within `foo` from the `l s' t` call, this will attempt to do a specialisation of `foo` when it hits a call site like in `bar1`. But now there's no matching specialisation of `l` anymore: The one which was a candidate before also assumes `n-1` as an argument. This can potentially make things much worse. So the whole signature thing seems like not such a good idea after all. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14951#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler