Conversation
Also fix faulty forEachAccumulatingImpl, parMap, parZip
Kover Report
|
|
To be honest, I'm not super-happy with this change. It's true that you don't expose things like
|
|
That behaviour change is intentional, but I should've done it in a separate PR. |
|
w.r.t. constraining it to |
# Conflicts: # arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/raise/RaiseAccumulate.kt
Yes, please. I think that aligning |
|
@serras Thanks for steering me away from implementation changes! The PR is much simpler now. It's just marking things as |
I realized this is a bad API to have.
Accumulateis meant to be an effect. Already, it's important to keep effect interfaces minimal.The crucial fault here is that
latestErrorreveals too much aboutAccumulate: it lets you check whether a failure has happened, and short-circuit early if so.This means that introducing
accumulate { }changes that behaviour easily. We want an Accumulate-using expressioneto be equivalent toaccumulate(::either) { e }.bindNelOrAccumulate(), but this wasn"t the case withlatestErrorexposed. Now this equivalence is true.The only "legitimate" use for it was in
accumulate, which heavily implies that it was an implementation detail;accumulatewants to know, after the block runs, whether any errors happened. It now gets access to that implementation detail by picking the exact implementation ofAccumulateit wants (namelyListAccumulate).