Problem 6, haskell