News for hackers. Stuff that matters.
Re:SICP 2.6: Church Numerals (2011) by rspeer on Monday May 12, 2014 @01:33AM (#7731328)
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.

There are no comments on this comment yet.