Solve 1 in haskell