-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
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
R.pipe(R.tryCatch, ...) anomaly #3387
Comments
Hi @orsenkucher , could you post some sample input? |
@kedashoe Hi! const data = /* Just paste string from sample */;
const res = deltas(data);
console.log(res);
|
Also if you call |
So I think the problem is the bare
We created |
@kedashoe Thanks for your input! Yeah, JSON.parse seems just not to work with Ramda.
|
JSON.parse accepts 3 arguments, so ramda is auto-currying the remaining arguments, you can do R.pipe(
R.tryCatch(R.unary(JSON.parse), R.always({})),
R.pathOr("", ["choices", 0, "delta"]),
R.objOf("delta"),
R.mergeRight({ isDone: false })
) |
Thanks @jlissner! |
I don't think it would be considered an issue. Ramda has made a choice to auto curry arguments in certain settings. You could make a post stating your case for why ramda should not auto curry in a tryCatch if you feel strongly about it. |
Yes ramda does this pretty much everywhere to determine arity of the functions it creates, it would be quite a change to do something different at this point. It is usually the builtins/functions which accept optional arguments which catch people out. I will close now but feel free to discuss further. |
Yep, I mean it's not the issue with Ramda, just was asking on how to make this github issue more indexable for other people if faced with an alike situation. |
Ah good thought.. probably fine to leave it, but ya something like what you suggested is good |
"ramda": "^0.29.0".
With
Magic Fix
I get expected results:Commenting
R.tap(() => {})
line what I get is:The text was updated successfully, but these errors were encountered: