An exercise for learning Haskell