R.compose( R.match(new RegExp(value, 'i')), R.prop('name') ); var filtered = R.filter(nameEquals, list); Imperative var filtered = [], i = 0, pattern = new RegExp(value, 'i'); for (i = 0; i < list.length; i += 1) { if (list[i].name.match(pattern)) filtered.push(list[i]); }
var add = R.curry(function (x, y) { return x + y; }); // addOne :: Number -> Number var addOne = add(1); addOne(5); //=> 6 A curried function can be easily specialized for your own needs.