haskell problem 9