Learning Haskell via implementing a type system and type inference on a simple functional language.
https://github.com/jin/hindley-milner
Typeclasses were surprisingly easy to grasp. Got tripped up for a couple of days trying to implement a way to generate fresh variables ("a", "b", ...) and ultimately grokked the State monad to implement it.