If you want to learn how HM typechecking works by studying working (Haskell) code, I would recommend the papers below. The code in these papers is closer to how you would actually implement a type checker in practice.
[1]: https://www.microsoft.com/en-us/research/wp-content/uploads/...