Higher-order function
lastmod 2020-08-27created 2020-08-273 edits
In mathematics and computer science, a higher-order function is a function that does at least one of the following:
- Takes one or more functions as arguments (e.g. procedural parameters).
- Returns a function as its result.
All other functions are first-order functions. In mathematics, higher-order functions are also called operators or functionals. The differential operator in calculus is a common example, since it maps a function to its derivative.
In the untyped lambda calculus, all functions are higher-order. In the typed lambda calculus, from which most functional programming languages are derived, higher-order functions that take one function as an argument are values with types of the form \({\displaystyle (\tau _{1}\to \tau _{2})\to \tau _{3}}\).