diff --git a/source/curry.js b/source/curry.js index 6610ff893..3e96f47a5 100644 --- a/source/curry.js +++ b/source/curry.js @@ -27,23 +27,7 @@ import curryN from './curryN.js'; * - `g(_, 2)(_, 3)(1)` * * Please note that default parameters don't count towards a [function arity](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/length) - * and therefore `curry` won't work well with those: - * - * ``` - * const h = R.curry((a, b, c = 2) => a + b + c); - * - * h(40); - * //=> function (waits for `b`) - * - * h(39)(1); - * //=> 42 - * - * h(1)(2, 3); - * //=> 6 - * - * h(1)(2)(7); - * //=> Error! (`3` is not a function!) - * ``` + * and therefore `curry` won't work well with those. * * @func * @memberOf R @@ -56,11 +40,14 @@ import curryN from './curryN.js'; * @example * * const addFourNumbers = (a, b, c, d) => a + b + c + d; - * * const curriedAddFourNumbers = R.curry(addFourNumbers); * const f = curriedAddFourNumbers(1, 2); * const g = f(3); * g(4); //=> 10 + * + * // R.curry not working well with default parameters + * const h = R.curry((a, b, c = 2) => a + b + c); + * h(1)(2)(7); //=> Error! (`3` is not a function!) */ var curry = _curry1(function curry(fn) { return curryN(fn.length, fn);