Partial Application

Partial application is the technique of supplying some, but not all, of a function’s arguments to produce a new function that takes the remaining arguments. Given a two-argument function add, partially applying it to the value 5 yields a one-argument function, often called add5, that adds 5 to whatever it is given. The original function is unchanged; a new, more specialized function is produced.

This depends on functions being first-class values that can be created and returned at will. SICP’s treatment of higher-order procedures establishes exactly this capability, describing procedures such as average-damp and newton-transform that “return new procedures.” A partially applied function is one of these returned procedures, with some arguments already captured.

Partial application is closely related to currying. Currying transforms a multi-argument function into a chain of single-argument functions; once a function is curried, applying it to one argument naturally returns a function awaiting the rest, which is partial application in action. The two ideas are often used together, though partial application can be applied to ordinary multi-argument functions as well.

The practical benefit is specialization: a single general function can be adapted into many focused ones without rewriting logic. This makes partially applied functions convenient to hand to higher-order operations like map and filter, where a one-argument function is exactly what is required.