Added a simple implementation for Scala.