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