Solutions to the exercises from Functional Programming in Scala book