Curried Function Lengths Are Wrong
mgreystone opened this issue · 4 comments
mgreystone commented
The use of uncurryN
is causing functions to return with incorrect lengths. See #26 .
Examples:
const arity2 = (a, b) => {}
// In funky 1.3.1, these all have a length of 2
// In funky 1.4.2, these all have a length of 1
combineAll([ arity2 ]).length
combineAllP([ arity2 ]).length
combineWith(merge, arity2).length
Options:
- Force all returning functions to be unary functions.
- Follow the "ramda" pattern to force function lengths to be evaluated during compositon.
In other words, remove auto curry. ForcecombineAll(arr)(data)
& drop support forcombineAll(arr, data)
. Ramda does not allowjuxt(arr, data)
for this exact reason. - Attempt to apply auto curry magic. #35
rpearce commented
If no. 3 creates more trouble than it's worth, I am ok with no. 2 and living with that
mgreystone commented
My vote continues to be for option 2. I'm not interested in taking #35 any further, but @rpearce (or anyone) please feel free to bang on it.
rpearce commented
I'm with you, then. @flintinatux: any opinions?
flintinatux commented
Depends on which convention we want to follow. I intentionally decided to make tinyfunk
only support unary functions, partially for this reason, and partially because it makes the code so much simpler. But ramda
tries to support all-the-things. If that's us too, then it's ok to follow the same patterns as ramda
.