Skip to content

Missing scala.Tuple.flatMap #13163

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

Open
nicolasstucki opened this issue Jul 27, 2021 · 5 comments
Open

Missing scala.Tuple.flatMap #13163

nicolasstucki opened this issue Jul 27, 2021 · 5 comments
Assignees

Comments

@nicolasstucki
Copy link
Contributor

Compiler version

3.0

Description

We have Tuple.FlatMap to compute the type of Tuple.flatMap but we do not implement Tuple.flatMap.

We should implement it in a similar way as what is described in #12888.

@nicolasstucki nicolasstucki added itype:enhancement Spree Suitable for a future Spree labels Jul 27, 2021
@nicolasstucki
Copy link
Contributor Author

Tests can be added to tests/pos/tuple-flatmap.scala.

@FunFunFine
Copy link

What's about other methods, e.g. fold? Its implementation is missing too

@nicolasstucki
Copy link
Contributor Author

Not sure how a fold signature would look like. It is worth exploring. I'm not so sure that this method would be useful, it might end up equivalent to tup.toList.foldLeft(...).

@KacperFKorban KacperFKorban self-assigned this Jul 27, 2021
KacperFKorban added a commit to KacperFKorban/dotty that referenced this issue Aug 3, 2021
@nicolasstucki nicolasstucki removed the Spree Suitable for a future Spree label Aug 9, 2021
dwijnand pushed a commit to KacperFKorban/dotty that referenced this issue Aug 19, 2021
@nicolasstucki
Copy link
Contributor Author

We have a good implementation in #13245, but the signature is not ideal. We should revisit this PR in the future when we have more flexibility with type arguments (such as defining def f[T][U]).

@SethTisue
Copy link
Member

we have def f[T][U] now (SIP-47), does it help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants