[Haskell] logic problem