We continue our discussion of higher-order functions:
We discuss combinators. Combinators are higher-order functions that lift operations from a type to functions with values in that type. Combinators are defined using the pointwise principle. Currying makes this easy in SML.
We discuss staging. Staging takes advantage of the nested lambda form of a curried function to move parts of a computation close to the place where the arguments required for the computation appear. This can save computation time in a function that can do some of its work as soon as it sees its first argument, for instance. When called several times with the same first argument and different second arguments, the function can reuse the results of these early partial computations.
We generalize some higher-order list functions to trees.