exercises from the book "Functional Programming in Scala" by Chiusano and Bjarnason