
Inference dependent on functional dependencies is unpredictably bad. The
#13774: Singletons code fails to typecheck when type signature involving type family is added -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.1 checker) | Keywords: FunDeps, Resolution: | TypeFamilies 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: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * cc: goldfire (added) * keywords: TypeFamilies => FunDeps, TypeFamilies Comment: Some possible wisdom from the `singletons` [https://github.com/goldfirere/singletons/tree/f9910fef9084ad9e3ca6b4f713c882... #known-bugs README]: problem is that a use of an associated type family tied to a class with fundeps doesn't provoke the fundep to kick in. This is GHC's problem, in the end. And this [https://github.com/goldfirere/singletons/issues/37#issuecomment-41488816 comment]:
If only a type family could have functional dependencies, we could get somewhere, but alas, no. (Sidenote: of course, a type family can be declared within a class with functional dependencies, but GHC doesn't apply the fundeps when examining the type family.)
I was unable to dig up anything which explained these comments. Richard, can you elaborate more on this interaction between type families and functional dependencies? Is there an existing ticket which describes the root issue? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13774#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler