# Y Combinator

From here.

Note:

1. “(x x)”[the latter one] means “apply ‘x’ to ‘x’”, we can use “A1” to represent the result;

2. “(λx.f (x x))”[the latter one] means “apply ‘A1’ to ‘λx.f’”, we can use “B1” to represent the result;

3. “(x x)”[the former one] means “apply ‘x’ to ‘x’”, we can use “A2” to represent the result;

4. “(λx.f (x x))”[the former one] means “apply ‘A2’ to ‘λx.f’”, we can use “B2” to represent the result;

5. “λ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.

Notes:

“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:

1. Yin is the source of everything, including Yang.

2. Yin is difficult to observe or understand, while Yang is not.

3. 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“.