problem6 haskell