Explicit forall

  • The forall keyword
  • When you need explicit forall
  • Explicit type arguments
Implication graph
ScopedTypeVariables ExplicitForAll

The GHC language extension called ExplicitForAll enables one fairly small, albeit useful, addition to Haskell’s syntax for writing type signatures: the forall keyword.

You don’t often need to be concerned with enabling this extension, because if you need explicit forall, it’s probably because you’re using some other extension that enables it automatically, such as ScopedTypeVariables, RankNTypes, or ExistentialQuantification.

You can also see some discussion of explicit forall in the videos about TypeApplications and ScopedTypeVariables.

This extension has been available in GHC since the 6.12.1 release.GHC documentation for ExplicitForAll.

Sign up for access to the full page, plus the complete archive and all the latest content.