Created
March 9, 2011 14:10
-
-
Save PavelPenkov/862241 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Array.prototype.map2 = function(f) { | |
return fold([], SynLib.append.combine(f)); | |
} | |
Function.prototype.combine = function(g) { | |
return function() { this(g(arguments)) }; | |
} | |
var SynLib = { | |
append: function(array, x) { | |
array.push(x); | |
return array; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment