Solve problem 188 using Haskell.