Working through the examples in the Functional Programming in Scala book