3 ms·
i guess it depends on how familiar you are with the lambda calculus and the various "tricks" for representing data as lambdas. from a quick look at the relevan
by uryga 6y ago
i guess it depends on how familiar you are with the lambda calculus and the various "tricks" for representing data as lambdas.
from a quick look at the relevant section, it seems to be using [Scott-encoded natural numbers](https://fermat.github.io/document/talks/lam.pdf https://fermat.github.io/document/talks/lam.pdf). i think describing it as "leaving S and Z up to some implementation" sells it short! the (quite beautiful) idea is roughly that you represent a number by a [fold/reduce]-like function that'll iterate the function you pass it (`s`) the appropriate amount of times, starting from an initial value (`z`).