We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#94 (comment)
I think we’d need to link between functions that do more or less the same thing, but take a different number of parameters.
The text was updated successfully, but these errors were encountered:
How about we add a @see tag to the jsdoc?
@see
i.e.
/** * @module 1-liners/curry * * @description * * Curry a function – split its list of parameters into 2 lists. * * @see curryRight * @see uncurry * @see uncurry3 * ... */
### curry Curry a function – split its list of parameters into 2 lists. ```js import curry from '1-liners/curry'; import reduce from '1-liners/reduce'; import compose from '1-liners/compose'; // You can use reduce and compose to create curry3,4 and so on. const curry3 = compose(curry, curry); const curry4 = reduce(compose, [curry, curry, curry]); const f = (a, b, c, d) => a * b * c * d; const fβ = curry(f); // ~= curry2 const fγ = curry3(f); // ~= curry3 const fδ = curry4(f); // ~= curry4 f(1, 2, 3, 4) === 24 fβ(1)(2, 3, 4) === 24 fβ(1, 2)(3, 4) === 24 fβ(1, 2, 3)(4) === 24 fγ(1)(2)(3, 4) === 24 fγ(1)(2, 3)(4) === 24 fδ(1)(2)(3)(4) === 24
(f) => (...a) => (...b) => f(...a, ...b);
Sorry, something went wrong.
I’d rather keep it minimal like:
Related: curryRight • uncurry • uncurry3
But definitely 👍 to that!
No branches or pull requests
#94 (comment)
I think we’d need to link between functions that do more or less the same thing, but take a different number of parameters.
The text was updated successfully, but these errors were encountered: