-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
when(resolved:) tuple overloads #1092
base: v7
Are you sure you want to change the base?
Conversation
Seems cool. Can we make tests pass? |
6b0f972
to
d13d220
Compare
Done :) |
still interested in merging? :) |
This would be great - is there a timeline on this or is PMK7 incompatible/already implementing this? |
9e44117
to
e6e8f32
Compare
If we can base this onto v7 we can get it in. |
Ok great! Give me some time :) |
d13d220
to
b433e10
Compare
|
Merge conflicts. |
The PR was still set to merge to |
CI did not run (GitHub Actions bug perhaps) we need that to verify that the changes do not cause ambiguity. Even then I am concerned about the change of I'd like to see this PR without all the infrastructure changes since it bloats it substantially. |
The ambiguity usages were due to the variadic
But we agreed that it is better to have tuple arity functions, as variadic is easy to fix as you just add [ and ] around the arguments. From the calling point of view it is almost no difference. Not sure what is more convenient with variadic arguments that an array couldn't handle. By infrastructure you mean adding a common module? |
b433e10
to
4acf52e
Compare
@mxcl I got rid of the infrastructure changes. |
4acf52e
to
51c223c
Compare
Ideally I'd fix it, but I have no idea what it is testing even. Yay.
…r thenables and cancellable thenables add an associated type R representing the result type in Thenable which improves when(resolved:) return type
51c223c
to
7a65168
Compare
Hello @Skoti |
Thanks for revisiting this PR. Honestly, I can't see anything similar. Not much has changed since then. I think this PR brings a lot of benefits, but because the Anyway, in the modern Swift with Please do what you think is best. |
This PR introduces tuple overloads for
when(resolved:)
(which make use ofThenable
protocol) and additional tuple overloads forwhen(fulfilled:)
up to 9 arguments.This PR also introduces an associated type
R
representing the result type inThenable
protocol which improves a return type inwhen(resolved:)
when using Guarantees, so this is now allowed:In the future it might be worth considering changing the
pipe
declaration to useR
instead ofResult<T>
, this would however impact all the other operators so I didn't want to introduce such a big change in this PR.