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
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to