An exercise in Scala for a talk on the topic