simple fast curry implementation inspire by ramda
and @riim/curry
var curry = require('fast-curry');
var sum = curry(function(a, b) { return a + b; });
var addOne = sum(1);
console.log(addOne(2));
// => 3
Benchmark sources can be found in the folder
Create - sum = curry((a, b) => a + b)
- least important result
Lift - addOne = sum(1)
Call - addOne(2)
- much more important result than the previous two
Results in K ops/sec.
Library | Create | Lift | Call |
---|---|---|---|
fast-curry | 11,381,182 | 8,833,228 | 19,496,006 |
ramda/R.curry | 7,247,796 | 8,294,710 | 12,819,816 |
@riim/curry | 3,460,089 | 7,929,335 | 3,605,139 |
curry | 14,404,001 | 2,596,561 | 1,665,675 |
cast-curry | 8,831,008 | 1,127,958 | 2,498,141 |
just-curry | 5,008,961 | 1,555,059 | 1,453,120 |
auto-curry | 3,673,706 | 1,487,674 | 1,230,014 |
light-curry | 23,778,508 | 5,122,704 | 2,037,435 |
@thisables/curry | 751,430 | 1,466,132 | 976,244 |
@ibrokethat/curry | 16,650,913 | 2,270,749 | 5,113,183 |
instant-curry | 25,928,526 | 3,904,823 | 13,582,536 |
fj-curry | 15,964,714 | 3,035,876 | 2,264,332 |
curry-d | 10,620,788 | 2,122,769 | 1,735,257 |