Skip to content
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

StreamConverters toScala: add type class for collections with efficient merging #11466

Open
lrytz opened this Issue Apr 3, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@lrytz
Copy link
Member

commented Apr 3, 2019

In 2.13, scala.jdk.StreamConverters adds a toScala extension method to streams that allows converting a stream to arbitrary Scala collections.

Collecting a parallel stream is especially efficient when the target collection supports efficient merging.

Currently the toScala method is special-cased for the Accumulator factory. It would make sense to generalize the ad-hoc AccumulatorFactoryInfo into a type class for collections that support efficient merging.

@Ichoran

This comment has been minimized.

Copy link

commented Apr 4, 2019

@lrytz - It probably would be good, but we have approximately zero collections that have efficient merging. (The only one I can think of offhand is ListBuffer, and it doesn't split efficiently, so it's kind of a dead end for stream processing.) So I don't think it's too critical right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.