Skip to content

Instantly share code, notes, and snippets.

@hughfdjackson
Last active December 18, 2015 13:49
Show Gist options
  • Select an option

  • Save hughfdjackson/5792595 to your computer and use it in GitHub Desktop.

Select an option

Save hughfdjackson/5792595 to your computer and use it in GitHub Desktop.
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