Added Haskell solution and code explanation