|Version 2 (modified by loeh@…, 11 years ago) (diff)|
Rank 2 Types
Functions may have polymorphic arguments, described by explicit type signatures, e.g.
runST :: (forall s. ST s a) -> a
A special case of RankNTypes.
- may be seen as syntactic sugar for PolymorphicComponents
In my opinion rank 2 types are a prerequisite for PolymorphicComponents, because in the presence of polymorphic components, the constructors of data types already have rank 2 types. — Andres
- simple type inference
- enables runST and similar devices
- used in cheap deforestation
- can be awkward in comparison with RankNTypes