Haskell Language Arbitrary-rank polymorphism with RankNTypes


GHC’s type system supports arbitrary-rank explicit universal quantification in types through the use of the Rank2Types and RankNTypes language extensions.


  • Arbitrary rank quantification is enabled with either the Rank2Types or RankNTypes language extension.
  • With this extension enabled, the forall keyword can be used to add higher-rank quantification.