[Haskell-cafe] Rank-2 types and class constraints
Ralf.Laemmel at cwi.nl
Wed Dec 1 11:12:27 EST 2004
foo _ = undefined
Otherwise the poor little "a" has no chance to get disambiguated.
... Ambiguous type variable `a' in the top-level constraint ...
Stefan Holdermans wrote:
> Just out of curiosity (I cannot come up with a practical example):
> Why doesn't the following piece of code type check in GHC (with
> > foo :: (forall a . (Eq a) => a) -> Integer
> > foo = undefined
> It seems like the type-class constraint is playing a decisive rôle
> here, since the following does check.
> > bar :: (forall a . a) -> Integer
> > bar = undefined
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe