Why curry fn will return value when developer doesn't pass enough params? #3409
Replies: 1 comment 2 replies
-
I do think you've found a bug. I don't know why the console ends up with the Note that the string of placeholders at the end of the first call have no effect. Here is a simplified example showing the issue: const _ = R.__;
const h = R.curry((a, b, c, d, e) =>({
a, b, c, d, e
}));
const r = h(1, 2)(_, 4, 5, 3)
const s = h(1, 2)(_, 4, 5)(3)
console.log(r) //=> {a:1, b: 2, c: R.__, d: 4, e: 5} // Oops!
console.log(s) //=> {a:1, b: 2, c: 3, d: 4, e: 5} // Works ok Have you done any digging into the source code to determine why this happens? I assume it's because the call with Any interest in trying to write a PR to solve this? |
Beta Was this translation helpful? Give feedback.
-
When i view curry function, i find curry will return placeHolder when i pass params that not seems correctly?
e.g.
It will happen the following
I'm not sure it is expected.
If not
I think curry cound impore it with modify internal implementation
Beta Was this translation helpful? Give feedback.
All reactions