-
Notifications
You must be signed in to change notification settings - Fork 363
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
Group by key and fold each group simultaneously #23
Comments
I'm understanding from the 'alternatives' section that the motivation for this is performance. It'd be nice if there was a motivation section at the top of the KEEP template to make the reasoning for introducing a new feature clearer. The reason I say it must be performance is that the only 'con' listed against Is the assumption that implementing a form of stream fusion in the compiler would break code that relies on side effects? I mean, just recognising the |
@mikehearn Yes, performance (namely the allocations) is the reason why
Not every operation available on |
TODO: Experiment with fluent API |
Rather than creating a |
Isn't it what |
Quite more verbose:
|
Name I propose naming it |
import java.util.stream.Collectors.groupingBy
val list = listOf("ab", "cde", "x")
with (list) {
stream().collect(groupingBy<String, Int> { it.length })
// ^^^^^^^ required Collector, found Grouping
}
|
We consider such situation, when the extension |
The declarations have been released in Kotlin 1.1, thus I'm closing the KEEP. Do not hesitate to open a YouTrack issue for any additional suggestions. |
Discussions about the Operation to group by key and fold each group simultaneously will be held here.
The text was updated successfully, but these errors were encountered: