Skip to content

Instantly share code, notes, and snippets.

@thosakwe
Last active November 29, 2016 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thosakwe/c48efe075b5ed7c63b5c2f81bd0367af to your computer and use it in GitHub Desktop.
Save thosakwe/c48efe075b5ed7c63b5c2f81bd0367af to your computer and use it in GitHub Desktop.
Generate curry functions
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]);
}
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