![]() ![]() Note that while in JavaScript application of a function (x=>x) to an argument y requires brackets around the argument: (x=>x)(y), in the Lambda Calculus application of some expression f to some other expression x is indicated simply fx. Here, we apply the lambda (λx.x) to the variable y: (λx.x)y What can we do with such a lambda expression? Well we can apply it to another expression (The same way we can apply anonymous functions to an argument in JavaScript). The K combinator which we wrote as x=>y=>x in JavaScript, is written λxy.x. The expression λx.xy is not a combinator, because y is not bound to any parameter, it is free. Thus, the expression λx.x is a combinator because the variable x is bound to the parameter. A combinator is a lambda expression (function) with no free variables.We have already discussed combinators in JavaScript, now we can give them a more formal definition: a sequence of nested univariate functions). x y, but they are implicitly curried (e.g. ![]()
0 Comments
Leave a Reply. |