-
Notifications
You must be signed in to change notification settings - Fork 451
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
["Request"] Consider overloading Arrow Fx ParZip for tupling #2821
Comments
@nomisRev Something like this, as an addition, for each public suspend inline fun <A, B> parZip(
crossinline fa: suspend CoroutineScope.() -> A,
crossinline fb: suspend CoroutineScope.() -> B,
): Pair<A, B> = parZip(Dispatchers.Default, fa, fb) { a, b ->
Pair(a, b)
} Also... |
Hey @lgtout,
Actually, we're going to remove these signatures and they should just take So the functions should be exactly as you've shown here: public suspend inline fun <A, B> parZip(
context: CoroutineContext = EmptyCoroutineContext,
crossinline fa: suspend CoroutineScope.() -> A,
crossinline fb: suspend CoroutineScope.() -> B,
): Pair<A, B> = parZip(context, fa, fb) { a, b ->
Pair(a, b)
} This should be done for Thanks for looking into this ticket @lgtout. You can just target this to |
@nomisRev Got it. Thanks! |
@nomisRev Existing |
Yes, that would be great @lgtout! Thank you 🙏 |
Support Pair, Triple, and Tuple4-9 return types.
@nomisRev Should I write tests for the added |
Hey @lgtout,
Since the code in your PR should be derived from these methods, I don't think any additional tests are needed. WDYT? |
@nomisRev Okay, that works. |
Hey @lgtout, Thank you for being so thorough |
Will do!
😄 Always! |
Support Pair, Triple, and Tuple4-9 return types.
Support Pair, Triple, and Tuple4-9 return types.
When working with
parZip
you often want to combine it withEffect
, rather than exposing many variants of the API these API compose naturally. In Arrow 1.x.x we decided not to overloadparZip
with a defaultlambda
for the size of the binary.Since Arrow 2.0 will significantly reduce the size of the binary, we should consider adding these overloads again. For example, when ignoring results or turning values into a tuple it currently requires some annoying overhead.
See discussion on Slack: https://kotlinlang.slack.com/archives/C5UPMM0A0/p1662715323510559
The text was updated successfully, but these errors were encountered: