Add problem 2 in Haskell