Last active
October 9, 2017 12:10
-
-
Save taiju/1725a55664ca39a1865f095337887a36 to your computer and use it in GitHub Desktop.
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
const two = (s) => (z) => (s) ((s) (z)) | |
const three = (s) => (z) => (s) ((s) ((s) (z))) | |
const mult = (m) => (n) => (s) => (z) => (n) ((m) (s)) (z) | |
const toInt = (n) => (n) (x => x + 1) (0) | |
// six = (mult) (two) (three) | |
// six = ((m) => (n) => (s) => (z) => (n) ((m) (s)) (z)) ((s) => (z) => (s) ((s) (z))) ((s) => (z) => (s) ((s) ((s) (z)))) | |
// six = ((m) => (n) => (s) => (z) => (n) ((m) (s)) (z)) ((x) => (y) => (x) ((x) (y))) ((a) => (b) => (a) ((a) ((a) (b)))) | |
// six = ((n) => (s) => (z) => (n) (((x) => (y) => (x) ((x) (y))) (s)) (z)) ((a) => (b) => (a) ((a) ((a) (b)))) | |
// six = ((n) => (s) => (z) => (n) ((y) => (s) ((s) (y))) (z)) ((a) => (b) => (a) ((a) ((a) (b)))) | |
// six = (s) => (z) => ((a) => (b) => (a) ((a) ((a) (b)))) ((y) => (s) ((s) (y))) (z) | |
// six = (s) => (z) => ((b) => ((y) => (s) ((s) (y))) (((y) => (s) ((s) (y))) (((y) => (s) ((s) (y))) (b)))) (z) | |
// six = (s) => (z) => (((y) => (s) ((s) (y))) (((y) => (s) ((s) (y))) (((y) => (s) ((s) (y))) (z)))) | |
// six = (s) => (z) => (((y) => (s) ((s) (y))) ((s) ((s) ((s) ((s) (z)))))) | |
const six = (s) => (z) => (s) ((s) ((s) ((s) ((s) ((s) (z)))))) | |
; // wtf | |
(toInt) (six) // => 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment