[Haskell-cafe] Aren't type system extensions fun?

Don Stewart dons at galois.com
Mon May 26 17:22:15 EDT 2008


andrewcoppin:
> 
> Today I was reading a potentially interesting paper, and I stumbled 
> across something referred to as a "rank-2 type". Specifically,
> 
>  class Typable x => Term x where
>    gmapT :: (forall y. Term y => y -> y) -> x -> x
> 
> At this point, I am at a complete loss as to how this is any different from
> 
>  gmapT :: Term y => (y -> y) -> x -> x
> 
> Can anybody enlighten me?

If in doubt, consult the fine user's guide:

    Section 8.7.4. Arbitrary-rank polymorphism
    http://www.haskell.org/ghc/docs/latest/html/users_guide/other-type-extensions.html#universal-quantification


-- Don


More information about the Haskell-Cafe mailing list