3 ms·
> Could we still define factorial? This was the problem facing the developers of the lambda calculus (which doesn’t have built-in recursion). Lambda calculus d
by tromp 5y ago
> Could we still define factorial? This was the problem facing the developers of the lambda calculus (which doesn’t have built-in recursion).
Lambda calculus doesn't have built-in numbers either.
Curiously, the standard representation of numbers in lambda calculus,
the so-called Church numerals, allows for a non-recursive
definition of factorial [1]:
fac = λnλf.n(λfλn.n(f(λfλx.n f(f x))))(λx.f)(λx.x)
> There’s more to type checking than Haskell’s rigid declarations.
I don't see such rigidity since most type declarations in Haskell can be omitted as they will be correctly inferred.
[1] https://flownet.com/ron/lambda-calculus.html https://flownet.com/ron/lambda-calculus.html