exercises from Real World Haskell book