A bulky solution to problem 26 in Haskell.