lambdax
lambdax
is an small module that allows you to implement partial application and build lambda expressions.
Install
- npm
npm install --save lambdax
- bower
bower install --save lambdax
Usage
lambdax
exposes two functions: partial()
and negate()
;
var partial = partial;var negate = negate;
partial()
- partial() simple use:
{ return a + b + c;}var sumPlus15 = ;; // => 60
- partial() simple use passing context and arguments:
{ var _self = this; return people;} var getJohnColeguesNamesFromPeople = ; ;
- partial() use as a builder:
var findBackendDeveloper = ; ;
negate()
- negate() simple use
var f = ; // => false.
- negate() simple use passing context and arguments:
var minAge = 18;var maxAge = 30;var isAgeNotInRange = ; ;
- negate() use as a builder:
var isNotAgeInRange = ; ;
Note: see test folder for more examples.