Solve #37 in Haskell.