Solve 1 in Haskell