Get the latest tech news
Damas-Hindley-Milner inference two ways
What is Damas-Hindley-Milner?
Damas-Hindley-Milner (HM) is a type system for the lambda calculus (later adapted for Standard ML and the ML-family languages) with parametric polymorphism, aka generic functions. In order to make inference for polymorphism decidable (I think), you have to pick some limited set of points in the concrete syntax to generalize types. We won’t have an implementation here, but you should go take a look at the paper which does a nice side-by-side of W and M. Reader, if you would like to contribute a small version of Algorithm M using our data structures, I would be happy to include it.
Or read this on Hacker News