10.07.2015 Views

An Introduction to Functional Programming Through Lambda Calculus

An Introduction to Functional Programming Through Lambda Calculus

An Introduction to Functional Programming Through Lambda Calculus

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

- 19 -giving:λx.x<strong>An</strong> identity operation always leaves its argument unchanged. In arithmetic, adding or subtracting 0 are identityoperations. For any number : + 0 = - 0 = Multiplying or dividing by 1 are also identity opeartions: * 1 = / 1 = The identity function is an identity operation for λ functions.We could equally well have used different names for the bound variable, for example:or:λa.aλyibble.yibble<strong>to</strong> define other versions of the identity function. We will consider naming in more detail later but note just now that wecan consistently change names.2.7. Self application functionConsider the rather odd function:λs.(s s)which applies its argument <strong>to</strong> its argument. The bound variable is:sand the body expression is the function application:(s s)which has the name:sas function expression and the same name:sas argument expression.Let us apply the identity function <strong>to</strong> it:(λx.x λs.(s s))In this application, the function expression is:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!