[Haskell-cafe] Rank N type tutorial?

Greg Buchholz haskell at sleepingsquirrel.org
Fri Oct 27 13:31:18 EDT 2006


    Anyone know of a good source for learning about higher ranked types?
I'm not quite sure why this is illegal...

> foo :: Integer -> (forall a. Show a => a)
> foo 2 = ["foo"] 
> foo x = x

...while this is just fine...

> bar :: Integer -> (forall a. Show a => a->b) -> b 
> bar 2 k = k ["bar"] 
> bar x k = k x

Thanks,

Greg Buchholz


More information about the Haskell-Cafe mailing list