Haskell problem 22