Coding along with chapter 9 of Functional Programming in Scala (Manning MEAP)