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

Felipe Lessa felipe.lessa at gmail.com
Sat Nov 14 21:00:20 EST 2009

On Sun, Nov 15, 2009 at 01:14:34AM +0000, Lennart Augustsson wrote:
> Of the two declarations
> >        data Fizzle a = Fizzle (b -> (a, b)) a
> >        data Fizzle a = forall b. Fizzle (b -> (a, b)) a
> only the second one is allowed (with some suitable extension).
> Personally I think the first one should be allowed as well, with the
> same meaning as the second one.
> Some people thought it was to error prone not to have any indication
> when an existential type is introduced,
> so instead we are now stuck with a somewhat confusing keyword.

I think you are able to say

  data Fizzle a where
    Fizzle :: (b -> (a,b)) -> a -> Fizzle a



More information about the Haskell-Cafe mailing list