Iterating the Scala way