operation on a function and one or more parameter values, that produces a new function with the given parameter values “fixed”. • partial(f, 5) → g(x) • g(x) == f(5, x)
a function, that converts a function of multiple parameters into a series of functions of a single parameter: f(x, y, z) → f(x)(y)(z) • Functions are automatically curried in several functional languages, such as Haskell and F#. • A curried function is trivial to partially apply, as we can just execute a subset of the functions: f(2) → g(y, z) = f(x, y, z) • As such, currying and partial application are often confused.
that can be used for partial application. • The first parameter to bind() is bound to this inside the function, and subsequent parameters are bound to the function parameters in order.
some of the parameters to a function separately from the function call itself. • We can use it to customize functions for callbacks or to modularize logic for a DRYer codebase. • Javascript provides Function.bind for partially applying a function. • This is a technique that I find myself using all the time now that I am familiar with it.