3 ms·
If I'm not mistaken, this isn't the full Y combinator yet. It's a partial step towards deriving the full Y combinator. (f => (x => x(x))(y => f(x => y(y)(x
by nightcracker 10y ago
If I'm not mistaken, this isn't the full Y combinator yet. It's a partial step towards deriving the full Y combinator.
(f => (x => x(x))(y => f(x => y(y)(x))))
(func => n => (n === 0) ? 1 : (n * func(n - 1)))
(19)
Notice that the ugly func(func)(n-1) recursive call with the proper Y combinator simply became func(n-1).
The full Y combinator is also vastly more mystical and less obvious than the partial step :)
- thethirdone 10y ago> The full Y combinator is also vastly more mystical and less obvious than the partial step :) The full Y conbinator simply binds func to func(func) as seen in `(y => f(x => y(y)(x))))`, an easy jump to make and pretty easy to understand.
- viebel 10y agoThe full Y combinator is presented in the sequel of the current article: http://blog.klipse.tech/lambda/2016/08/10/pure-y-combinator-javascript.html http://blog.klipse.tech/lambda/2016/08/10/pure-y-combinator-...