haskell problem 12