Higher Order Imperative Programming
Aaron Kershenbaum, David R. Musser, Alexander A. Stepanov · 2004
It is argued that a programming style based on higher order techniquesthe use of procedures that have other procedures as arguments andor resultscan be most eectively employed if it is driven by abstraction from real algorithms rather than attempting to work with a xed set of functional forms and the use of imperative forms and mutative procedures is permitted even encour aged \t rather than restricting to a purely applicative style A sequence of examples is presented illustrating a number of higher order techniques operators iterators accumulation reduction parallel reductionand their eective use in conjunction with mutative procedures The examples culminate with an interesting family of sorting algorithms illustrating how higher order techniques can lead naturally to new algorithms