wiki:Rank2Types

Version 1 (modified by ross@…, 10 years ago) (diff)

--

Rank 2 Types

See ExtensionDescriptionHowto for information on how to write these extension descriptions. Please add any new extensions to the list of HaskellExtensions.

Brief Explanation

Functions may have polymorphic arguments, described by explicit type signatures, e.g.

runST :: (forall s. ST s a) -> a

A special case of RankNTypes.

References

Pros

  • may be seen as syntactic sugar for PolymorphicComponents
  • simple type inference
  • enables runST and similar devices
  • used in cheap deforestation

Cons