Chapter 12 applicative: exercise 12