Type checker for Type families
For a type family and a class definition:
type family F a x :: *
class FunctorF x where fmapF :: d -> (a -> b) -> F x a -> F x b
Curiously if I have
fff a = fmapF a id
it compiles correctly. But if I infer the type signature of fff I get
fff :: forall d x. (FunctorF d) => d -> F d x -> F d x
On the other side, a similar problem as before arises when
fff :: forall d x. (FunctorF d) => d -> F d x -> F d x
fff a = fmapF a id
This follows up from http://hackage.haskell.org/trac/ghc/ticket/2157
On Tue, Mar 18, 2008 at 7:03 PM, Ryan Ingram <ryani.spam@gmail.com> wrote: Interestingly, this works when you also give a type signature to "id":
fff :: forall d x. (FunctorF d) => d -> F d x -> F d x
fff a = fmapF a (id :: x -> x)
compiles for me (ghc6.8.2). There's probably a bug in the type checker; inference is working with no type signatures, but checking fails.
Trac metadata
Trac field | Value |
---|---|
Version | 6.9 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler (Type checker) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | Unknown |
Architecture | Unknown |