type-inferencer icon indicating copy to clipboard operation
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:

  1. 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)]]
  2. 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)]]
  3. [[https://eli.thegreenplace.net/2018/unification/][Unification]] - A blog post.
  4. [[https://github.com/vkz/PLAI/blob/master/type-unify.rkt][type-unify.rkt]] - An unification implementation in Racket.