Related question probably: why ghc compiles this:
> {-# LANGUAGE RankNTypes, ImpredicativeTypes #-}
> methods :: [(String, forall b. Eq b => b)]
> methods =
> [ ("method1", undefined )
> , ("method2", undefined) ]
> test:: [String]
> test= pmap methods
> where pmap = map fst
But when I change 'test' to:
> test:: [String]
> test= map fst methods
I get:
Cannot match a monotype with `forall b. (Eq b) => b'
Expected type: [(String, b)]
Inferred type: [(String, forall b1. (Eq b1) => b1)]
In the second argument of `map', namely `methods'
In the expression: map fst methods
Failed, modules loaded: none.
--
View this message in context:
http://old.nabble.com/type-class-constraints-headache-tp27752745p27779518.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe