Pearls of Functional Algorithm Design in Scala