This repository will contain a set of Haskell programs and related material to teach you how to build type inference algorithms. We start with basic Hindley-Milner and work our way to dependent types.
Only a basic background in computer science is required. The examples gradually increase in complexity.
- Hindley-Milner type inference
- Optimising Hindley-Milner type inference
- Constraint-based Type Inference
This repository wouldn't be possible without the following excellent materials:
- Write You A Haskell by Stephen Diehl provided much of the boilerplate for the classical Hindley-Milner code as well as some essential hints on how the algorithm works in specific cases.
- EvEff by Ningning Xie for providing a very clean implementation of algebraic effects, making it that much easier to combine monad-like computations.
- Typing Haskell in Haskell by Mark P. Jones contains an essential overview of Haskell's type system.
The code in this repository is licensed under the MIT license unless otherwise noted. You are free to fork this repository and make changes. Just make sure to leave a reference to the original content.