Exercices from the book Programming Erlang (2nd edition)