Added Haskell solution