These are chat archives for ramda/ramda
R.converge( R.multiply, [R.identity, R.identity] )()?
yeah converge isn't behaving how I'd expect, I think it's sniffing the arities of the inputs to determine the arity of the final function.
var fn = R.converge((a,b) => [a,b], [R.identity, R.multiply])
I'd expect this to evaluate to:
[10, multiply(10)] but instead I get a curried function
R.curry((a, b) => a * b))- it doesn't work
a => b => a * bit will work most likely
looks like @davidchambers was the furthest back commit author for that line I can see that introduced the max check https://github.com/ramda/ramda/blob/v0.24.1/src/converge.js#L37
Which is somewhat ironic considering a recent proposal to sanctuary to only include unary currying
R.binary- but I shot myself in the foot.
var mul = R.curry( (a,b) => a * b )
mul(2,2) is valid, so
R.curry reports an arity / argument length of 2
convergeshould do the arity check it's doing, perhaps it makes sense in another corner case.
(a, b) => getFunction(a)(b)
const getFunction = a => b => [a, b] // or whatever const f = uncurryN(2, getFunction) f(1, 2)