Type inference Algorithm W in Haskell