Example of Partial Function in Scala