[Haskell-beginners] forall confusion
haskell-beginners at foo.me.uk
Sat May 29 11:35:42 EDT 2010
I was wondering if someone could give me an intuitive explanation of why in
f :: forall a.(Show a) => a -> String
f x = show x
"forall a.(Show a) => a" appears to translate into "Any a, as long as it
is an instance of Show"
but if I use forall in an type qualifier in an assignment:
myList =  :: [forall a.(Show a) => a]
"forall a.(Show a) => a" seems to mean "Any a, as long as it is bottom"
I've been poring over
for the last hour and I feel like my eyes are starting to melt.
As usual, any input would be warmly received :)
All the best,
More information about the Beginners