Most of the well-known algorithms are first-order, in the sense that their input and output are "plain" data. Some are second-order in a trivial way, for example sorting, hashtables or the map and fold functions: they are parameterized by a function, but they don't really do anything interesting with it except invoke it on pieces of other input data.
Some are also second-order but somewhat more interesting:
- Fingertrees parameterized by monoids
- Splitting a fingertree on a monotonous predicate
- Prefix sum algorithms, again usually parameterized by a monoid or a predicate etc.
Finally, some are "truly" higher-order in the sense that is most interesting to me:
- The Y combinator
- Difference lists
Do there exist other nontrivial higher-order algorithms?
In attempt to clarify my question, under "nontrivial higher-order" I mean "using higher-order facilities of the computational formalism in a critical way in the algorithm's interface and/or implementation"