Last active
December 18, 2015 13:49
-
-
Save hughfdjackson/5792595 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
| var opLift = require('op-lift') | |
| var opAll = function(operator){ | |
| var args = Array.prototype.slice.call(arguments) | |
| var opFn = opLift(operator) | |
| for ( var i = 0, len = args.length; i < len - 1; i += 1) | |
| if ( opFn(args[i], args[i + 1]) ) return false | |
| return true | |
| } | |
| var identity = function(a){ return a } | |
| var f = identity | |
| opAll('<', 1, f(2), 2) //= false | |
| opAll('<=', 1, f(2), 2) //= true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment