[Haskell-cafe] Solved but strange error in type inference

Yucheng Zhang yczhang89 at gmail.com
Tue Jan 3 12:35:05 CET 2012


As I understand it, both ways work.

> legSome ((LegGram g)::LegGram nt t s) ntV

If you compile this without ScopedTypeVariables extension, GHC will
remind you of it:

>    Illegal signature in pattern: LegGram nt t s
>        Use -XScopedTypeVariables to permit it

So another solution is to avoid the ugly redundancy is:

> legSome :: forall nt t s . LegGram nt t s -> nt -> Either String ([t], s)



More information about the Haskell-Cafe mailing list