separate R.where into two simpler functions: R.where and R.whereEq - #1036
Conversation
There was a problem hiding this comment.
I'd love to remove this special case.
1fc3c7b to
497119f
Compare
|
IMO |
|
I'm fine with this as long as whereEq = compose(where, mapObject(eq)) |
|
Damn, it hadn't hit me how straightforward that conversion was:
Nice. |
|
Shall I add |
|
I could be happy with this version of |
|
not reservations. just not seeing the point particularly. |
|
I say yes, then. Two simple functions beat one complex function hands-down. |
|
I've added |
There was a problem hiding this comment.
Is this valid use of the word specialization?
|
((:bell:)) @buzzdecafe, @CrossEye |
|
i don't mind the complexity of the original. i don't really object to this, but it doesn't excite me either. i expect this may break a lot of stuff that uses this is nice: |
Certainly. In most cases, users will need to replace -R.where({x: 1, y: 2})
+R.whereEq({x: 1, y: 2})In each of the remaining cases, each non-function value in the spec must be wrapped with -R.where({x: 1, y: 2, z: R.gte(R.__, 0)})
+R.where({x: R.eq(1), y: R.eq(2), z: R.gte(R.__, 0)}) |
|
Sorry, I thought I'd made it clear that I was in favor of this. I do think that sometime soon, we'll have to look at the basic implementation. If I'm not mistaken, in the Great Curry Debacle of 2014, we reset this one in such a way that it might have lost some of the benefits that had been gained by the initial manual currying we had done. This one was the function that showed us the need for changes to our old currying, and it had some interesting behavior... |
separate R.where into two simpler functions: R.where and R.whereEq
|
Let's just make sure this is bold, highlighted, underlined in change log as
|
|
yep, totally agree |
|
not sure what to make of this: http://jsperf.com/mapobj-test |
|
I could certainly get behind a more efficient implementation. It was API complexity this pull request sought to reduce. |
There was a problem hiding this comment.
Any reason you're not using keys here (it'd be faster)?
There was a problem hiding this comment.
Sounds like a good idea to me!
Closes #1032
This is the alternative to #1034. If we decide we want both functions we need to decide what to name them. :)