Pearls of Functional Algorithm Design