1 | Y = λf.(λx.f (x x)) (λx.f (x x)) |
From here.
Note:
“(x x)”[the latter one] means “apply ‘x’ to ‘x’”, we can use “A1” to represent the result;
“(λx.f (x x))”[the latter one] means “apply ‘A1’ to ‘λx.f’”, we can use “B1” to represent the result;
“(x x)”[the former one] means “apply ‘x’ to ‘x’”, we can use “A2” to represent the result;
“(λx.f (x x))”[the former one] means “apply ‘A2’ to ‘λx.f’”, we can use “B2” to represent the result;
“λf.(λx.f (x x)) (λx.f (x x))” means apply “B1” to “λf.B2”.
From here(1), here(2) and here(3) and here(4).
Here is the JavaScript version.
1 | function y(le) { |
Notes:
1 | 1. "return function (f) { return f(f); }" creates a function which invokes the |
“y/function_1” is Yin, “F/function_2” is Yang. Imagine the “太极图(taijitu)“: the Yin head eats the Yang tail while the Yin tail is eaten by the Yang head.
Some more interesting points about Yin/Yang:
Yin is the source of everything, including Yang.
Yin is difficult to observe or understand, while Yang is not.
Yin can produce Yang and Yang can produce Yin, Yin can consume Yang and Yang can also consume Yin.
In functional programming, the Y combinator can be used to formally define recursive functions in a programming language that does not support recursion.
From here.
“无中生有”, which means creating something(or maybe everything) from nothing, that is “Y combinator“.