Last active
November 29, 2017 15:14
-
-
Save rsp/96cd139b546447372483a9c5c52af7c7 to your computer and use it in GitHub Desktop.
The input functions from https://github.com/rsp/ifm-lw-r1-ojs
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
// Applies x() 1 time: | |
function input1(x) { | |
return function (y) { | |
return x(y); | |
}; | |
} | |
// Applies x() 2 times: | |
function input2(x) { | |
return function (y) { | |
return x(x(y)); | |
}; | |
} | |
// Applies x() 10 times: | |
function input3(x) { | |
return function (y) { | |
return x(x(x(x(x(x(x(x(x(x(y)))))))))); | |
}; | |
} | |
// Applies x() 100 times: | |
function input4(x) { | |
return input3(input3(x)); | |
} | |
// Applies x() 1000 times: | |
function input5(x) { | |
return input3(input4(x)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment