Lambda abstraction
From HaskellWiki
(Difference between revisions)
(eta -> beta plus minor changes) |
(Categorize, add infobox.) |
||
| Line 1: | Line 1: | ||
| + | [[Category:Glossary]] | ||
| + | {{Foundations infobox}} | ||
A ''lambda abstraction'' is another name for an [[anonymous function]]. It gets its name from the usual notation for writing it: for example, <math>\lambda x \to x^2</math>. (Another common but equivalent notation is: <math>\lambda x . \ x^2</math>.) | A ''lambda abstraction'' is another name for an [[anonymous function]]. It gets its name from the usual notation for writing it: for example, <math>\lambda x \to x^2</math>. (Another common but equivalent notation is: <math>\lambda x . \ x^2</math>.) | ||
Revision as of 18:44, 5 February 2007
A lambda abstraction is another name for an anonymous function. It gets its name from the usual notation for writing it: for example,
. (Another common but equivalent notation is:
.)
\
->
\ x -> x * x
There is actually a whole mathematical theory devoted to expressing computation entirely using lambda abstractions: the lambda calculus. Most functional programming languages (including Haskell) are based upon some extension of this idea.
When a lambda abstraction is applied to a value—for instance,
—the result of the expression is determined by replacing every free occurrence of the parameter variable (in this case x) with the parameter value (in this case 7). This is a beta reduction.
