functional-programmingtypesinferencehindley-milner

What is Hindley-Milner?


I encountered this term Hindley-Milner, and I'm not sure if grasp what it means.

I've read the following posts:

But there is no single entry for this term in wikipedia where usually offers me a concise explanation.
Note - one has now been added

What is it?
What languages and tools implement or use it?
Would you please offer a concise answer?


Solution

  • Hindley-Milner is a type system discovered independently by Roger Hindley (who was looking at logic) and later by Robin Milner (who was looking at programming languages). The advantages of Hindley-Milner are

    Hindley-Milner is the basis for the type system of almost every statically typed functional language. Such languages in common use include

    All these languages have extended Hindley-Milner; Haskell, Clean, and Objective Caml do so in ambitious and unusual ways. (Extensions are required to deal with mutable variables, since basic Hindley-Milner can be subverted using, for example, a mutable cell holding a list of values of unspecified type. Such problems are dealt with by an extension called the value restriction.)

    Many other minor languages and tools based on typed functional languages use Hindley-Milner.

    Hindley-Milner is a restriction of System F, which allows more types but which requires annotations by the programmer.