What’s the best way to implement a classic curry function in actionscript with a nice syntax?
I’ve tried:
Function.prototype.curry = function() { return 'helloWorld'; } trace((function():void {}).curry());
…approach but that didn’t work.
I guess I’m stuck with a ugly approach such as:
FunctionUtils.curry(fp, ... args)
???
I must admit I’ve never understood the difference between ‘curry’ and ‘partial’. I use the following function to do more or less what you want to do:
Usage examples: