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

Ryan Ingram ryani.spam at gmail.com
Thu Nov 12 14:48:58 EST 2009

On Thu, Nov 12, 2009 at 2:50 AM, Eugene Kirpichov <ekirpichov at gmail.com> wrote:
> But that's not an issue of semantics of forall, just of which part of
> the rather broad and universal semantics is captured by which language
> extensions.

The forall for existential type quantification is wierd.

> data Top = forall a. Any a   -- existential
> data Bottom = All (forall a. a) -- rank 2

I think it makes much more sense in GADT syntax:

> data Top where
>    Any :: forall a. a -> Top
> data Bottom where
>    All :: (forall a. a) -> Bottom

where it's clear the forall is scoping the type of the constructor.

  -- ryan

More information about the Haskell-Cafe mailing list