Created
March 12, 2015 18:01
-
-
Save mjs2600/bf8457dd7172be148439 to your computer and use it in GitHub Desktop.
Church Numbers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define zero (lambda (f) (lambda (x) x))) | |
(define (add-1 n) | |
(lambda (f) (lambda (x) (f ((n f) x))))) | |
(define one | |
(lambda (f) | |
(lambda (x) | |
(f (((lambda (f) | |
(lambda (x) x)) f) x))))) | |
(define two | |
(lambda (f) | |
(lambda (x) | |
(f (((lambda (f) | |
(lambda (x) | |
(f (((lambda (f) | |
(lambda (x) x)) f) x)))) f) x))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment