Sample Haskell code from the book Real World Haskell