Skip to content

Generalize Future.traverse and Future.sequence #5233

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

Closed
wants to merge 1 commit into from
Closed

Generalize Future.traverse and Future.sequence #5233

wants to merge 1 commit into from

Conversation

markus1189
Copy link
Contributor

Allow CanBuildFrom to determine the resulting collection type, instead
of forcing it to be the same as the input. This allows to do a
Future.traverse on a Map[A,B] and using collection.breakOut get
back a Future[Map[A,B]] again.

@scala-jenkins scala-jenkins added this to the 2.11.9 milestone Jun 15, 2016
Allow `CanBuildFrom` to determine the resulting collection type, instead
of forcing it to be the same as the input.  This allows to do a
`Future.traverse` on a `Map[A,B]` and using `collection.breakOut` get
back a `Future[Map[A,B]]` again.
@markus1189
Copy link
Contributor Author

/cc @axel22 any thoughts?

@axel22
Copy link
Contributor

axel22 commented Jun 28, 2016

Looks like it should work.
Can't say if there are any cases where it breaks type inference, though.

@szeiger
Copy link
Contributor

szeiger commented Oct 26, 2016

It looks safe to me. It should always be possible to infer the 3rd type parameter. My only concern with this change is that we're planning to move away from CanBuildFrom in the 2.13 collections, which means removing collection.breakOut as one of the few breaking changes.

@markus1189
Copy link
Contributor Author

markus1189 commented Oct 28, 2016

@szeiger Thanks for picking this up. I am also fine with just closing this if it will be obsolete soon.

@szeiger
Copy link
Contributor

szeiger commented Oct 31, 2016

I suggest putting it on hold for a few months until we have a better idea of what the impact of the 2.13 collection changes will be on this PR.

@SethTisue
Copy link
Member

if anyone wants to pick this up, please (unless you're reading this after 2.13.0-M4 is out) take it up over in https://github.com/scala/collection-strawman

@SethTisue SethTisue closed this Feb 24, 2018
@SethTisue SethTisue removed this from the WIP milestone Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants