-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add IterableOps.groupFlatMap
method
#135
Comments
It could be added as part of my proposal here: #53 |
Iterable.groupFlatMap
methodIterableOps.groupFlatMap
method
@BalmungSan looks like there's some overlap of ideas here, but your proposal is more complex since you're changing the target type of collection. I would expect For example, I'd expect to keep the existing behaviour of val as = Seq(List(1), List(2))
val bs = as.flatMap(identity) The resulting type is Of course, at some point you could propose adding (Also updated issue title and description to reflect the fact that this should really live on |
We already have
IterableOps.groupMap
andgroupMapReduce
methods, does it make sense to add agroupFlatMap
method as well?In the simplest case this could just be an alias for
groupMapReduce(f)(g)(_ ++ _)
but if implemented separately it can be more efficient:Indeed
groupMapReduce
already states in its doc that it exists (solely?) because it's more efficient than rolling the behaviour by hand usinggroupBy(f).map(...)
. It also somehow "feels" like this is missing from the API since we generally expectmap
andflatMap
to come as a pair.The text was updated successfully, but these errors were encountered: