DeadCoders #1: Damas-Milner '82

DeadCoders #1: Damas-MilnerĀ '82

Type inference is a common property of polymorphically typed programming languages, including Java, C#, Haskell, Scala, and F#. It allows the compiler to automatically determine the types of expressions, reducing the burden on the programmer, while still allowing for compile-time type checking.

The Damas-Milner paper describes the first algorithm ("Algorithm W") for inferring and assigning types in the ML polymorphic type system. The algorithm runs in near-linear time (with respect to program size), making it feasible for real-world use.

I think type inference is a fascinating concept, and Algorithm W is actually quite simple.

0caf296ce6286bd7658b78a065141cc7?s=128

Alisdair McDiarmid

May 27, 2014
Tweet