-
Notifications
You must be signed in to change notification settings - Fork 19
Add groupMapReduce method to IterableOnceOps #23
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
Conversation
yes
possibly an oversight on Seth's part. I noticed it and planned to fix it or comment on it, but was waiting on a more concrete decision wrt package structure (see #24).
I don't know if it will, but I'd probably just copy the implementation from the stdlib.
sounds potentially valuable. I would recommend opening a separate ticket for that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, excepting the one parameter change I noted.
I do want to make sure this is formally accepted before we merge though. It's not clear to me if the issue is considered an enhancement or bugfix, and if the former, it needs formal acceptance into the scala library
src/main/scala/scala/collection/next/IterableOnceExtensions.scala
Outdated
Show resolved
Hide resolved
@NthPortal Absolutely, as I said in #24 I believe here should only exist things that are already accepted to be part of a future Scala release. I believe it would be worth adding a section in the README about when it is clear a change is to be accepted. |
Personally, I only think it is risky if you consider it to have been a significant amount of work. I agree that having an actual proposed/working implementation adds traction to it.
I think we should narrow this slightly to things labeled That's actually why I commented about being unsure if this was considered an enhancement or bugfix. Edit: I've executively decided it's an enhancement |
I just pushed the "parameter change" requested by @NthPortal as well as modifying the code so it follows the current most voted alternatives of the #24 & #46 proposals. |
src/main/scala/scala/collection/next/NextIterableOnceOpsExtensions.scala
Show resolved
Hide resolved
I've merged this, because I think it's fairly uncontroversial. finalizing the style can come before a release |
Fixes #8
I hope I correctly followed the structure and naming conventions that you want to enforce in this repo. I based my work here on what Seth is doing in #17 and I am aware that is also the first addition and that the guidelines may change, I subscribed to that PR to follow the discussion and conclusions (for example here I am following Sébastien advice on the naming of the implicit class), but if I miss something please let me know and I will happily push the requested changes.
Any kind of feedback is greatly welcome, but I am personally very interested in three things:
AnyVal
? I noticed Seth's one isn't and nobody discussed that. Is this just an oversight? Or personal preference? AFAIK for extension methodsAnyVal
should guarantee no instantiation and shouldn't have any funny side-effect since the class is not expected to be used as a type. But maybe I am missing something, maybe it has some problems with binary compatibility or something. Please let me know what you guys think about this.updateWith
) could have a negative impact on performance.Also, I would also like to propose adding
groupByTo(factory)(key)
andgroupMapTo(factory)(key)(f)
methods as well. What do you guys think? May I also add them in this PR or in another one? Or don't you find them useful (I do)?