Skip to content

Keep a warning's problems when it is combined with a failure - #952

Merged
hugo-vrijswijk merged 1 commit into
typelevel:mainfrom
toddburnside:fix-parallel-warning-problem-accumulation
Sep 28, 2026
Merged

hugo-vrijswijk merged 1 commit into
typelevel:mainfrom
toddburnside:fix-parallel-warning-problem-accumulation

Conversation

@toddburnside

Copy link
Copy Markdown
Contributor

While doing a parSequence on a list of Results, I found that Problems were accumulated for Warnings, but only until a Failure was found in the list. After that, the Problems of new Failures were accumulated, but new Warnings were ignored.

This seems to be an oversight rather than a conscious decision. For comparison, cats Ior accumulates in both directions.

Note that the current implementation is lawful since the Applicative laws only constrain the values. This is why the laws tests did not catch it. But it does seem inconsistent to me.

claude wrote the test.

@hugo-vrijswijk hugo-vrijswijk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me. Thanks!

@hugo-vrijswijk
hugo-vrijswijk merged commit e200bcc into typelevel:main Sep 28, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants