Inmathematics,function applicationis the act of applying afunctionto an argument from itsdomainso as to obtain the corresponding value from itsrange.[1]In this sense, function application can be thought of as the opposite of functionabstraction.

Representation

edit

Function application is usually depicted by juxtaposing the variable representing the function with its argument encompassed inparentheses.For example, the following expression represents the application of the functionƒto its argumentx.

In some instances, a different notation is used where the parentheses aren't required, and function application can be expressed just byjuxtaposition.For example, the following expression can be considered the same as the previous one:

The latter notation is especially useful in combination with thecurryingisomorphism. Given a function,its application is represented asby the former notation and(orwith the argumentwritten with the less common angle brackets) by the latter. However, functions in curried formcan be represented by juxtaposing their arguments:,rather than.This relies on function application beingleft-associative.

As an operator

edit

Function application can be trivially defined as anoperator,calledapplyor,by the following definition:

The operator may also be denoted by abacktick(`).

If the operator is understood to be oflow precedenceandright-associative,the application operator can be used to cut down on the number of parentheses needed in an expression. For example;

can be rewritten as:

However, this is perhaps more clearly expressed by usingfunction compositioninstead:

or even:

if one considersto be aconstant functionreturning.

Other instances

edit

Function application in thelambda calculusis expressed byβ-reduction.

TheCurry–Howard correspondencerelates function application to the logical rule ofmodus ponens.

See also

edit

References

edit
  1. ^Alama, Jesse; Korbmacher, Johannes (2023),"The Lambda Calculus",in Zalta, Edward N.; Nodelman, Uri (eds.),The Stanford Encyclopedia of Philosophy(Winter 2023 ed.), Metaphysics Research Lab, Stanford University,retrieved2024-02-29