Solve #55 in Haskell.