Solve #62 in Haskell.