added the haskell solution