Damas-Hindley-Milner type inference algorithm implementation

前端 未结 1 905
梦如初夏
梦如初夏 2021-01-31 19:41

I\'m looking for information about the well-known Damas-Hindley-Milner algorithm to do type inference for functional languages, especially information about implementation.

相关标签:
1条回答
  • 2021-01-31 20:12

    If you're comfortable with ML code, the best way to find these things is to simply look into the implementations in the wild. A good reference implementation is HaMLet, which is designed as more of a test platform rather than a production implementation.

    Almost all serious recent discussion of these issues is going to be in scholarly venues. One paper that might be of interest is Generalising Hindley-Milner type inference algorithms.

    Also, the implementations of various type systems (including let polymorphism) in Pierce's "Types and Programming Languages", as well as Appel's "Modern Compiler Implementation in ML" more closely match modern approaches to implementing this than the vanilla description of algorithm W.

    0 讨论(0)
提交回复
热议问题