Adding two numbers: add

(define add (lambda (m n) (lambda (f) (compose (m f) (n f))))) |

This abstraction returns the arithmetic sum of two Church Numerals. The simple abstraction `compose' allows us to elegantly define the abstraction for addition. But that things are not quite as simple as they look is demonstrated in our first appendix. Please refer to a detailed analysis of addition and multiplication using the example:

Georg P. Loczewski 2004-03-05