2008年10月19日星期日

Hindley–Milner type inference algorithm

Hindley–Milner is a polymorphic extention of simply typed lamda calculus, weaker than system F. It is also the name of type inference algorithm is this type system.
This wiki page give its basic principle. The basic principle is that first use some type variable and semantic of abstraction and application to generate a list of type constraint, and then use unification to solve it. In one world, to find the most general type setting to satisfy the list of type constraint.
Here is the implementation of Hindley–Milner in perl language. it is based on Basic Polymorphic Typechecking.

没有评论: