|
GADT: weird error message: msg#00019lang.haskell.glasgow.bugs
In the code below the function "trans" is accepted by GHC 6.4, but "trans1" is not. I would expect that "(x,y)" is just syntactic sugar for "(,) x y", but apparently it isn't. I guess this is a bug; can anyone explain what is going on? Cheers, Arthur The Code: data Equal a b where Eq :: Equal a a trans :: forall a b c. Equal a b -> Equal b c -> Equal a c trans = \x -> \y -> case (,) x y of (Eq,Eq ) -> Eq trans1 :: forall a b c. Equal a b -> Equal b c -> Equal a c trans1 = \x -> \y -> case (x, y) of (Eq,Eq ) -> Eq The error message: Test2.hs:9:0: Quantified type variable `c' is unified with another quantified type variable a When trying to generalise the type inferred for `trans1' Signature type: forall a b c. Equal a b -> Equal b c -> Equal a c Type to generalise: Equal a b -> Equal b a -> Equal a a In the type signature for `trans1' When generalising the type(s) for `trans1'
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [ ghc-Bugs-1282571 ] +RTS -xc and SIGINT handler gives seg fault, SourceForge.net |
|---|---|
| Next by Date: | inconsistency with "ghc-pkg describe", Frederik Eaton |
| Previous by Thread: | [ ghc-Bugs-1282571 ] +RTS -xc and SIGINT handler gives seg fault, SourceForge.net |
| Next by Thread: | GADT: weird error message, Arthur Baars |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |