[Haskell] functional dependency violation?