Last active
November 29, 2016 12:48
-
-
Save thosakwe/c48efe075b5ed7c63b5c2f81bd0367af to your computer and use it in GitHub Desktop.
Generate curry functions
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
function add2(num) { | |
return num + 2; | |
} | |
function add2_array(num[]) { | |
return num.map(function(num) { | |
return add2(num); | |
}); | |
} | |
function curryThis(a, b, c) { | |
return a + b + c; | |
} | |
function curryThis_1(a, b) { | |
return function(c) { | |
return curryThis(a, b, c); | |
}; | |
} | |
function curryThis_2(a) { | |
return function(b, c) { | |
return curryThis(a, b, c); | |
}; | |
} | |
function main() { | |
const arr = add2_array([1, 2, 3]); | |
} |
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
function add2(num) { | |
return num + 2; | |
} | |
function curryThis(a, b, c) { | |
return a + b + c; | |
} | |
function main() { | |
const arr = add2([1, 2, 3]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment