[Haskell-cafe] What does the `forall` mean ?

Andrew Coppin andrewcoppin at btinternet.com
Thu Nov 12 14:52:47 EST 2009

Eugene Kirpichov wrote:
> 2009/11/12 Andrew Coppin <andrewcoppin at btinternet.com>:
>> Joe Fredette wrote:
>>> Forall means the same thing as it means in math
>> ...which not everybody already knows about. ;-)
>> Even I am still not 100% sure how placing forall in different positions does
>> different things. But usually it's not something I need to worry about. :-)
> To me it does not look like it does different things: everywhere it
> denotes universal polymorphism. What do you mean? I might be missing
> something.

I just meant it's not immediately clear how

  foo :: forall x. (x -> x -> y)

is different from

 foo :: (forall x. x -> x) -> y

It takes a bit of getting used to.

More information about the Haskell-Cafe mailing list