
#13295: Failure to resolve type parameter determined by type family -------------------------------------+------------------------------------- Reporter: alexvieth | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): The error is poor (ambiguity isn't really the issue), but I agree that GHC should reject your first function but accept your second. Your first function relies critically on the fact that `D` has but one constructor. Thus, we know that an element of `D` is constructed with `'D`. Without this knowledge, then `introG` really is problematic. Although we believe it's sound to do so, GHC does not currently do this kind of reasoning (i.e., eta-expansion). In `introG'`, the type signature tells us that `F t` evaluates to a use of `'D`, so the missing piece is provided. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13295#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler