[Haskell-cafe] forall vs "=>"

wren ng thornton wren at freegeek.org
Wed May 13 02:05:32 EDT 2009

Daryoush Mehrtash wrote:
> What is the difference between forall as in:
> runST :: (forall s. ST s a) -> a
> and the "=>" as in
> evalStateT :: Monad m => StateT s m a -> s -> m a

The forall is Rank-2 polymorphism (the argument must be polymorphic in 
s). The => is for typeclass constraints (restricting the Rank-1 
polymorphism on m, but not so far as to make it monomorphic).

Or did you have another question in mind?

Live well,

More information about the Haskell-Cafe mailing list