The Functional Programming Triad of fold, scan and iterate