diff --git a/js/src/Y.js b/js/src/Y.js --- a/js/src/Y.js +++ b/js/src/Y.js @@ -6,9 +6,11 @@ // Return the function that is the fixed point of f. const Y = f => (x => f(v => x(x)(v))) (x => f(v => x(x)(v))); +const Z = f => (f()); + // The factorial function is the fixed point of this: const f = fac => n => (n <= 1) ? 1 : n * fac(n - 1); print(`5! is ${Y(f)(5)}`);