Loading search index…
No recent searches
No results for "Query here"
Self-application combinator. Applies a function to itself. Forms the basis of recursion in lambda calculus.
export const Mockingbird = (x: Fn) => x(x); export const M = Mockingbird; export const SelfApply = M;
const factorial = Mockingbird((f: any) => (n: number) => (n <= 1 ? 1 : n * f(f)(n - 1))); factorial(5); // 120