Solve #74 in Haskell.