type-inferencer
type-inferencer copied to clipboard
hindley-milner algorithm
- Type Inferencer A toy implementation of Hindley-Milner type inference. The program walks through a given expression node, generates a set of constraints and unifies them to produce a set of substitutions.
Blog post: [[https://veera.app/type_inference.html][Type Inference]] ** Resources Here are the resources I used to learn this algorithm:
- Chapter 30 in [[https://cs.brown.edu/~sk/Publications/Books/ProgLangs/2007-04-26/plai-2007-04-26.pdf][Programming Languages: Application and Interpretation (first edition)]]
- Chapter 15.3.2 in [[https://cs.brown.edu/courses/cs173/2012/book/types.html#%28part..Type.Inference%29][Programming Languages: Application and Interpretation (second edition)]]
- [[https://eli.thegreenplace.net/2018/unification/][Unification]] - A blog post.
- [[https://github.com/vkz/PLAI/blob/master/type-unify.rkt][type-unify.rkt]] - An unification implementation in Racket.