
#10227: Type checker cannot deduce type -------------------------------------+------------------------------------- Reporter: augustss | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by adamgundry): * cc: adamgundry (added) Comment: One can go arbitrarily far in this direction, so it's not obvious when to stop. I agree that `D d Double ~ Bool` seems like it should be easily solved, but what about something like `D d Double ~ D d Bool`? This also can hold only if `d ~ In`, which could be detected by unifying stuck closed type family applications with each branch in turn and noticing that all but one lead to inconsistencies. I think this approach makes sense in terms of "improvement", but representing evidence for it would be difficult, so it would be hard to handle givens as opposed to wanteds. Moreover, it might not be very efficient! If anyone would like to experiment, though, this seems like a nice application for typechecker plugins. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10227#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler