-
Notifications
You must be signed in to change notification settings - Fork 114
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
Remove parallel errors from ZPure #1432
Remove parallel errors from ZPure #1432
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but @sideeffffect might have a different opinion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change makes sense, not only for the reasons mentioned but also because as a user I found the *Par methods confusing given that they don't execute concurrently (and shouldn't given that ZPure is synchronous)
@kyri-petrou I agree this is bad naming. We need to find a solution as this In my opinion, the example of Any idea, guys, on how we could fix that? 🤔 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I find the crux of the issue is whether we can make foldM
behave properly.
If yes, let's modify it to be lossless. Because these Par
methods can be useful (and intuitively named, since they hint at semantic parallelism).
If not, let's remove it all.
So what is the case? :)
c567bfc
I don't think it makes sense to fix An alternative is to do I'm personally not too bothered by the So, I think we should get rid of it 😄 And if someone really want to run multiple ZPure, they can use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, if we can't make it 100 % correct and consistent, then we must remove it.
Are we still using Cause
? Or can we remove it altogether now?
Removed it (replaced a few usages by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to merge, thank you 🙏
My PoV on the "semantic parallelism" thing: #1433 (comment) |
I propose to remove parallel errors from
ZPure
for several reasons:Validation
useZPure
, but this idea was abandoned whenZValidation
was introducedfoldM
is lossy via the use offirst
:foldCauseM((cause: Cause[E]) => failure(cause.first), success)
. This means a wide range of operators (mapError
,catchAll
, etc) are only keeping the first error anyway.Cause
being different fromzio.Cause
is confusing, as well as the termPar
which evokes concurrency, removing it simplifies the signature ofrunAll
.zipParLeft
andzipParRight
not accumulating errors correctly and nobody found it until now, which makes me think nobody uses these.