solve 8 in haskell