Scala Cookbook: Recipes for Object-Oriented and Functional Programming Chp09 recipe 9.4 Complex functions