[Haskell] Modular type inference