X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=lists_and_numbers.mdwn;h=e047312e695a9e3b364140b7aa099fc5ed7fab62;hp=6640d1704d6ebee5fb5750dba3916f48449ce775;hb=e09159ccfdc281101e7777af85e26d74cff95379;hpb=eaf3e66b4eae5288cd6fabbc8fde051c391821ac diff --git a/lists_and_numbers.mdwn b/lists_and_numbers.mdwn index 6640d170..e047312e 100644 --- a/lists_and_numbers.mdwn +++ b/lists_and_numbers.mdwn @@ -275,10 +275,14 @@ So, for example: Adding *m* to *n* is a matter of applying the successor function to *n* *m* times. And we know how to apply an arbitrary function s to *n* *m* times: we just give that function s, and the base-value *n*, to *m* as arguments. Because that's what the function we're using to implement *m* *does*. Hence **add** can be defined to be, simply: - \m \n. m succ n + \m n. m succ n Isn't that nice? +Alternatively, one could do: + + \m n. \s z. m s (n s z) + How would we tell whether a number was 0? Well, look again at the implementations of the first few numbers:
``````zero ≡ \s z. s0 z ≡ \s z. z
``````