Sample codes in "Programming in Scala"