[Haskell-cafe] arbitrary rank polymorphism and ghc language pragmas

Twan van Laarhoven twanvl at gmail.com
Thu Jul 5 17:32:33 CEST 2012

On 05/07/12 17:18, rickmurphy wrote:
> Hi All:
> I've been working through some details in these papers [1], [2] and
> noticed a language pragma configuration that I hope you can confirm.
> When using explicit foralls in a data constructor, it appears that GHC
> 7.4.2 requires Rank2Types in the Language pragma for what the papers
> consider rank 1 types.
> Here's an example:
> data T = TC (forall a b. a -> b -> a)
> Am I correct, or is there another extension? The ExplicitForAll does not
> appear to support rank 1 types in data constructors.

There is the PolymorphicComponents extension precisely for this use case.


More information about the Haskell-Cafe mailing list