Haskell implementation of the "Types and Programming Languages"