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