remove R.reduce and R.reduceRight#619
Conversation
ramda.js
Outdated
There was a problem hiding this comment.
I don't know the thinking behind using _checkForMethod here. The Fantasy Land Specification makes no mention of reduce or reduceRight. Furthermore, we're not consistent: R.reduce does not check for a reduce method.
There was a problem hiding this comment.
we will need some sort of dispatch mechanism on reduce if we make types traversable. at present we don't have any such types, so this can be unwrapped
|
OTOH
My pref is to keep both, but if we gotta remove one I would actually lean to removing |
|
Consistency with the names of built-in methods is valuable, but less so than internal consistency. If we can have our 🍰 and eat it too, marvellous. If not, let's make Ramda's function names cohesive. Standardizing on |
1029f2e to
8932051
Compare
|
imo if you do this, you should keep reduce in the docs, so that people can find fold when looking for reduce. for the non lispers 😄 |
|
@davidchambers I am firmly in favor of 🍰, both having and eating. |
|
i guess it makes sense to do this, esp. now that we have switched to |
|
/ping @CrossEye |
|
mmmm 🍰 |
|
Thought I responded earlier. 🌿 If we're going to get rid of the 👽's let's do it! |
remove R.reduce and R.reduceRight
|
i realize i'm too late, but one other thing: should fantasyland add foldable/traversable then they will probably standradize on |
|
Missing out on |
|
i agree, i think these aliases are worth keeping, esp. if I ever get back to transducer integration. 👍 for pay no attention to my comments above. 😛 |
|
I'm for internal consistency, but I dont see why you can't leave the aliases in there for compatibility. Our company has completely bought in to ramda, and after updating, our code and tests are throwing errors left and right everywhere we used |
|
❓ Where does this come from? I don't mind cleaning up the Ramda api (e.g. all this I came from a strong JavaScript and C++ background to enjoy doing FP with |
|
Agreeing with @semmel and @jschomay but I also think this change comes a bit fast. Even though ramda is < v 1.0.0 and no contract is broken by this change, it would have been nice with deprecation warnings so that people could adjust instead of running in to a wall of errors when upgrading. Just a thought for the future. /Captain Hindshight |
|
This was definitely too hasty. The parable was quite convincing. But I'm afraid that we will need to find a way to support aliases. I had said that this was the only alias pair I wanted to keep (#574 (comment)) but that for consistency we should probably remove even this one. I didn't know which one I'd prefer to keep. I think we chose wrong! But as I think about it again, I really would like for our dynamic dispatching to grow to support more compatible libraries. It would be great to be able to work more closely with tools like Highland, RxJs, Bacon, and possibly promise libraries (less likely as their terminology is quite different), as well as the various immutable collections. In order for that to work, we will probably want to have more, not fewer aliases. (Of course our current dynamic dispatch doesn't work with aliases in any case, so that would have to be straightened out first.) But I'm all for putting this one back immediately and pushing out 0.9.1 with this and any doc changes done so far. |
|
0.9.1 is already out, but i also support aliasing for |
|
Thank you! :) |
|
i think we will have to put this in 0.10 because some other changes have snuck in there before it. But we'll be doing that soon. |
|
in favor of alias. Plus, reading the homepage I assumed it was still in there, but I guess with such quick iterations, it isn't easy to keep it docs up to date. |
Many found this parable persuasive. There's support for removing the remaining 👽s.
I set to work on a patch to remove
R.foldlandR.foldr, but as I worked my way through the various files I became convinced that it'sR.reduceandR.reduceRightthat must go. Here are my reasons:foldlandfoldrare well liked. Several people have these in their shortlists of aliases to keep.foldlandfoldrare more consistent with our ad hoc naming scheme. We havelPartialandrPartial, for example, rather thanpartialandpartialRight.unfoldr. It's inconsistent to havereduceRightandunfoldr, andunreduceRightdoesn't exactly roll off the tongue.I'd love to merge this change and rebase #618 on top of it. The intersection of two ugly things (:alien:s and
.idxfunctions) is particularly confusing when every function lives in its own file.