Haskell: Sovled problem 5