A solution to the exercises at the end of Chapter 22 in the book Programming Erlang 2/ed by Joe Armstrong