higher-order function

A function that takes a function as an argument or returns one, such as map, filter or a wrapper that adds retries.

In more detail

Contextual typing gives the callbacks passed to higher-order functions their parameter types. Parameters<F> and ReturnType<F> let a wrapper return a function with exactly the same signature as the one it wraps.

Related terms

Taught in

References