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.is(Function) is not working correctly in R.ifElse #2654
Comments
This seems like something that should work... The following do work as intended:
Although they all express the same implementation. |
Yep, but it is anyway weird |
The problem is that So when you pass it While you can fix this by wrapping const fn = when(is(String), prop)
const fn = unless(is(Function), prop) For better or for worse, This issue with |
What's wrong with: const fn = f => R.is(Function, f) ? f : R.prop(f); It's less keystrokes and easier to understand? Also, though I agree with @CrossEye, this seems like an odd function. What are you trying to do? Edit: Oops, just realised that @nheisterkamp made the same point. |
@CrossEye could a note be added to
|
@bouzlibop: I have no objection. But I'm not sure how much it would help. I think the real problem is that it's easy to forget that something like |
How to reproduce:
REPL: link
Did I do something wrong?
The text was updated successfully, but these errors were encountered: