This Gist was automatically created by Carbide, a free online programming environment.
Last active
September 9, 2016 21:11
-
-
Save mcanas/5551cda70140709cffe8fae69f8d859a to your computer and use it in GitHub Desktop.
untitled
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 pipe( fns ) { | |
return function( x ) { | |
return fns.reduce(function(v, fn) { | |
return fn(v); | |
}, x ); | |
}; | |
} |
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 split( del ) { | |
return function( str ) { | |
return str.split(del); | |
} | |
} | |
var s = split(' '); | |
s("The quick brown fox"); |
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 map( fn ) { | |
return function( args ) { | |
return fn.bind(null, args); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment