Various exercises in Scala