If you already know all about higher-order programming and just want a javascript library with all the haskell/ML-style goodness, I highly recommend O. Steele's Functional library: http://osteele.com/sources/javascript/functional/
If nothing else, then his lambda() implementation with strings should be enough to convince you to use it.
Here's an implementation that I think is shorter, simpler to understand, easier to use, and doesn't require modifying existing functions for currification
function curry(fn) {
var wrappedFnMaker = function(accArgs) {
return function() {
var effectiveArgs = accArgs.concat(Array.prototype.slice.call(arguments));
if (effectiveArgs.length >= fn.length) {
return fn.apply(this, effectiveArgs);
} else {
return wrappedFnMaker(effectiveArgs);
}
};
}
return wrappedFnMaker([]);
}
add = curry(function(a,b,c) { return a + b + c; });
What's the deal with the stuff in the footer of this page? "The original page disappeared a couple of years ago. This is an unauthorized copy." It links to http://www.svendtofte.com/code/curried_javascript/ which I guess is the original article?
If nothing else, then his lambda() implementation with strings should be enough to convince you to use it.