Adding function types to the Haskell implementation