Here are some resouces to get started with type checking, ordered from high-level overview to deep dive:
- [Hindley-Milner Type System](https://en.wikipedia.org/wiki/Hindley%E2%80%93Milner_type_system)
- [Write You A Haskell](https://smunix.github.io/dev.stephendiehl.com/fun/index.html), most notably [this implemenation](https://github.com/sdiehl/write-you-a-haskell/tree/master/chapter7/poly_constraints)
- [Type Inference blog posts by Thunderseethe](https://thunderseethe.dev/posts/type-inference/)
- [Typing Haskell in Haskell](https://gist.github.com/chrisdone/0075a16b32bfd4f62b7b)
- [The Essence of ML Type Inference](http://gallium.inria.fr/~fpottier/publis/emlti-final.pdf)