Flexible types: robust type inference for first-class polymorphism
We present HML, a type inference system that supports full ﬁrstclass polymorphism where few annotations are needed: only function parameters with a polymorphic type need to be annotated. HML is a simpliﬁcation of MLF where only ﬂexibly quantiﬁed types are used. This makes the types easier to work with from a programmers perspective, and we found that it simpliﬁes the implementation of the type inference algorithm. Still, HML retains much of the expressiveness of MLF, it is robust with respect to small program transformations, and has a simple speciﬁcation of the type rules with an effective type inference algorithm that infers principal types. A reference implementation of the type system is available at: http://research.microsoft.com/users/daan/ pubs.html.