# Alpha conversion

### From HaskellWiki

(Difference between revisions)

(Added throwaway remark about usage.) |
BrettGiles (Talk | contribs) (Add infobox) |
||

Line 1: | Line 1: | ||

An ''alpha conversion'' (also written ''α conversion'') is a renaming variables. |
An ''alpha conversion'' (also written ''α conversion'') is a renaming variables. |
||

+ | {{Foundations infobox}} |
||

For example, suppose we have an expression such as |
For example, suppose we have an expression such as |
||

<haskell> |
<haskell> |

## Revision as of 19:49, 1 February 2007

An *alpha conversion* (also written *α conversion*) is a renaming variables.

For example, suppose we have an expression such as

\x y -> 2*x*x + y

and we change this to

\a b -> 2*a*a + b

This is clearly the same function, even though it uses different variable names. This process of renaming variables is *alpha conversion*.

*name capture*. For example, if we rename

x

y

\x -> x + y

\y -> y + y

Some compilers include an alpha conversion stage to rename all program variables such that variable names become unique. (This simplifies subsequent processing somewhat.)

Also see Lambda calculus and the wikipedia lambda calculus article.