Hacker News new | ask | show | jobs
by rspeer 4419 days ago
Let's use "twice" as the name of Church numeral 2, and "thrice" as the name of numeral 3.

If you look at the input and output of thrice, it looks like this:

   (function that gets applied once) -> (function that gets applied 3 times)
What if we used the output as the input again?

   (function that gets applied once) -> (function that gets applied 3 times) -> (function that gets applied 9 times)
We have a name for what we just did to the "thrice" function, and that name is "twice". So that's (twice thrice), and we can see it makes something happen 3^2 = 9 times.