Solve 8 in haskell