1.2.0 • Published 5 years ago
curry-fn v1.2.0
Instalation
npm install curry-fn
How to use
Normal use
const {curry} from 'curry-fn';
const add = (x, y, z) => x + y + z;
const curriedAdd = curry(add);
console.log(curriedAdd(1)(2)(3));
// if you pass more than one arg than the function will ignore them
console.log(curriedAdd(1)(2, 3)(3)); // => 6
Changelog
1.0.0
First release.
1.1.0
Tests added.
1.2.0
For the sake of fudamentalism, I removed somes features, given the fact that unary functions are a requirement in curry, and the potential leading to errors, and misunderstanding about arbitrary parameters sizes in function composition.
Removed features:
- Placeholders.
- Arbitrary arity.
- 1..N parameters per curried function.
Motivation
I just want to write some useful functional code in javascript.
TODO
add tests.- add code coverage.
Feel free to fork and contribute.