# Difference between revisions of "Lambda abstraction"

(eta -> beta plus minor changes) |
m |
||

(One intermediate revision by one other user not shown) | |||

Line 1: | Line 1: | ||

⚫ | |||

+ | [[Category:Glossary]] |
||

+ | {{Foundations infobox}} |
||

⚫ | |||

− | In Haskell source code, the Greek letter lambda is replaced by a backslash character ('<hask>\</hask>') instead, since this is easier to type and requires only the basic 7-bit ASCII character set. Similarly, the arrow is replaced with the |
+ | In Haskell source code, the Greek letter lambda is replaced by a backslash character ('<hask>\</hask>') instead, since this is easier to type and requires only the basic 7-bit ASCII character set. Similarly, the arrow is replaced with the ASCII character sequence '<hask>-></hask>'. So, for example, the lambda abstraction above would be written in Haskell as |

<haskell> |
<haskell> |

## Latest revision as of 19:54, 13 July 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, equivalent notation is: .)

In Haskell source code, the Greek letter lambda is replaced by a backslash character ('`\`

') instead, since this is easier to type and requires only the basic 7-bit ASCII character set. Similarly, the arrow is replaced with the ASCII character sequence '`->`

'. So, for example, the lambda abstraction above would be written in Haskell as

```
\ 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 ) with the parameter value (in this case ). This is a beta reduction.