Created
January 24, 2019 14:31
-
-
Save mrspeaker/da5903c0cf0fd378f986271cad60cee0 to your computer and use it in GitHub Desktop.
lambda pairs
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
let cons = (x, y) => f => f(x, y); | |
let car = p => p((x, y) => x); | |
let cdr = p => p((x, y) => y); | |
let p = cons("a", cons("b", "c")); | |
console.log(car(p), cdr(cdr(p))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment