[Haskell-cafe] What is the rank of a polymorphic type?

Eugene Kirpichov ekirpichov at gmail.com
Sat Dec 5 04:31:23 EST 2009


Consider the type: (forall a . a) -> String.

On one hand, it is rank-2 polymorphic, because it abstracts over a
rank-1 polymorphic type.
On the other hand, it is monomorphic because it isn't actually
quantified itself: in my intuitive view, a parametrically polymorphic
type has infinitely many instantiations (for example, Int -> Int is an
instantiation of forall a . a -> a, and String -> String also is), and
this type doesn't have any instantiations at all.

Which is correct? Is there really a contradiction? What is the
definition of rank of a polymorphic type?

Eugene Kirpichov
Web IR developer, market.yandex.ru

More information about the Haskell-Cafe mailing list