Solve 5 in haskell