-
Notifications
You must be signed in to change notification settings - Fork 448
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
Fixes recover inconsistency with raise DSL on types other than Either #3052
Conversation
@@ -79,4 +75,13 @@ class IorSpec : StringSpec({ | |||
} | |||
}.message shouldBe "Boom!" | |||
} | |||
|
|||
"Recover works as expected" { |
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.
This highlights the problem in the issue. This test fails without the change above.
@@ -238,6 +239,14 @@ public interface Raise<in Error> { | |||
is Either.Right -> value | |||
} | |||
|
|||
@RaiseDSL | |||
public fun <A> Ior<Error, A>.bind(): A = |
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 came to the idea of doing this from studying why either { recover({ ... }) { ... } }
works correctly. This ensures that in the recover block we hit this bind()
if we reference bind()
vs the one on IorScope
. This allows recover
to work in the way it does for either. However, the downside of this is, we do nothing with Ior.Both
's left value which may be undesirable.
Originally I tried adding a new recover(...)
method to IorRaise
but couldn't quite get that to work right without more major changes. However, I might have missed something there.
Furthermore, the issue identified with Ior
will happen with any other data type that has its own Raise variant. So NullableRaise
OptionRaise
etc. I didn't want to start making changes for that as I wanted to keep the discussion focused on the core problem. However, it's worth considering on this PR for sure.
Hey @yoxjames, First of all, sorry for the late reply! @RaiseDSL
public inline fun <A> recover(
@BuilderInference block: IorRaise<Error>.() -> A,
@BuilderInference recover: (error: Error) -> A,
): A = when (val ior = ior(combineError, block)) {
is Ior.Both -> {
combine(ior.leftValue)
ior.rightValue
}
is Ior.Left -> recover(ior.value)
is Ior.Right -> ior.value
}
For the above code to work we need to mark What do you think about that instead? It would fix "However, the downside of this is, we do nothing with Ior.Both's left value which may be undesirable.". @serras @franciscodr @raulraja I know we at some point discussed If we all agree I would like to add this in main before we release Thank you @yoxjames for raising this issue, and creating a PR with a proposal 🙏 Amazing first contributions 🙌 |
Honestly I was just hesitant to change any scoping. I do like this solution better though. I used this strategy and also added it (and tests) to Option, Nullable, and Result. Let me know if there are any additional questions. I couldn't get spotless to run (I didn't see it configured anywhere but have not used it and could be missing something). |
Hey @yoxjames, thanks for taking the time to test and fix this bug. @nomisRev, this implementation looks good to me. |
I added a couple of minor comments |
arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/raise/IorSpec.kt
Outdated
Show resolved
Hide resolved
@@ -6,6 +6,7 @@ | |||
package arrow.core.raise | |||
|
|||
import arrow.core.Either | |||
import arrow.core.Ior |
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.
This import is no longer required
import arrow.core.Ior | |
import arrow.core.Ior |
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.
Corrected.
…ise/IorSpec.kt Co-authored-by: Francisco Diaz <francisco.d@47deg.com>
@yoxjames Is this pull request still a work in progress? Otherwise, I can approve it |
Updated the description. Yeah I think this is no longer a WIP. Let me know if I should do anything else though! |
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.
One small nit, but PR looks great. Thank you so much for both the report, and fix @yoxjames! 🙌 Very impressive first-contribution. 👏 👏 👏
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/raise/Builders.kt
Outdated
Show resolved
Hide resolved
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/raise/Builders.kt
Outdated
Show resolved
Hide resolved
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/raise/Builders.kt
Outdated
Show resolved
Hide resolved
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/raise/Builders.kt
Outdated
Show resolved
Hide resolved
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.
Apart from Simon's comments, the proposal looks great. Thanks for contributing to the Arrow project, @yoxjames!
…ise/Builders.kt Co-authored-by: Simon Vergauwen <nomisRev@users.noreply.github.com>
…ise/Builders.kt Co-authored-by: Simon Vergauwen <nomisRev@users.noreply.github.com>
…ise/Builders.kt Co-authored-by: Simon Vergauwen <nomisRev@users.noreply.github.com>
…ise/Builders.kt Co-authored-by: Simon Vergauwen <nomisRev@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.arrow-kt:arrow-optics-ksp-plugin](https://github.com/arrow-kt/arrow) | `1.1.5` -> `1.2.0` | [![age](https://badges.renovateapi.com/packages/maven/io.arrow-kt:arrow-optics-ksp-plugin/1.2.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/io.arrow-kt:arrow-optics-ksp-plugin/1.2.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/io.arrow-kt:arrow-optics-ksp-plugin/1.2.0/compatibility-slim/1.1.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/io.arrow-kt:arrow-optics-ksp-plugin/1.2.0/confidence-slim/1.1.5)](https://docs.renovatebot.com/merge-confidence/) | | [io.arrow-kt:arrow-optics](https://github.com/arrow-kt/arrow) | `1.1.5` -> `1.2.0` | [![age](https://badges.renovateapi.com/packages/maven/io.arrow-kt:arrow-optics/1.2.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/io.arrow-kt:arrow-optics/1.2.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/io.arrow-kt:arrow-optics/1.2.0/compatibility-slim/1.1.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/io.arrow-kt:arrow-optics/1.2.0/confidence-slim/1.1.5)](https://docs.renovatebot.com/merge-confidence/) | | [io.arrow-kt:arrow-core](https://github.com/arrow-kt/arrow) | `1.1.5` -> `1.2.0` | [![age](https://badges.renovateapi.com/packages/maven/io.arrow-kt:arrow-core/1.2.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/io.arrow-kt:arrow-core/1.2.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/io.arrow-kt:arrow-core/1.2.0/compatibility-slim/1.1.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/io.arrow-kt:arrow-core/1.2.0/confidence-slim/1.1.5)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>arrow-kt/arrow (io.arrow-kt:arrow-optics-ksp-plugin)</summary> ### [`v1.2.0`](https://github.com/arrow-kt/arrow/releases/tag/1.2.0) [Compare Source](https://github.com/arrow-kt/arrow/compare/1.1.5...1.2.0) #### What's Changed - Add CNAME file to Dokka output by [@​franciscodr](https://github.com/franciscodr) in [https://github.com/arrow-kt/arrow/pull/3029](https://github.com/arrow-kt/arrow/pull/3029) - Remove legacy site code by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3030](https://github.com/arrow-kt/arrow/pull/3030) - Update README by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3033](https://github.com/arrow-kt/arrow/pull/3033) - Cancel previous PR action on new commit by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3032](https://github.com/arrow-kt/arrow/pull/3032) - Remove legacy script files by [@​franciscodr](https://github.com/franciscodr) in [https://github.com/arrow-kt/arrow/pull/3034](https://github.com/arrow-kt/arrow/pull/3034) - Ensure optics type with "data" modifier is a class by [@​DeoTimeTheGithubUser](https://github.com/DeoTimeTheGithubUser) in [https://github.com/arrow-kt/arrow/pull/3036](https://github.com/arrow-kt/arrow/pull/3036) - Update all dependencies (major) by [@​renovate](https://github.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3042](https://github.com/arrow-kt/arrow/pull/3042) - Remove test dependency from Arrow Fx by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3046](https://github.com/arrow-kt/arrow/pull/3046) - Bump Kotlin, KSP and coroutines version by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3047](https://github.com/arrow-kt/arrow/pull/3047) - fix mapIndexed when collecting multiple times by [@​hoc081098](https://github.com/hoc081098) in [https://github.com/arrow-kt/arrow/pull/3056](https://github.com/arrow-kt/arrow/pull/3056) - Update versions by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3058](https://github.com/arrow-kt/arrow/pull/3058) - optics ksp plugin: fixed handling of variance ([#​3057](https://github.com/arrow-kt/arrow/issues/3057)) by [@​vladd-g](https://github.com/vladd-g) in [https://github.com/arrow-kt/arrow/pull/3060](https://github.com/arrow-kt/arrow/pull/3060) - Fixes recover inconsistency with raise DSL on types other than Either by [@​yoxjames](https://github.com/yoxjames) in [https://github.com/arrow-kt/arrow/pull/3052](https://github.com/arrow-kt/arrow/pull/3052) - Change NonEmptySet type parameter name from T to A by [@​franciscodr](https://github.com/franciscodr) in [https://github.com/arrow-kt/arrow/pull/3062](https://github.com/arrow-kt/arrow/pull/3062) - Add withError and (Eager)Effect.mapError by [@​kyay10](https://github.com/kyay10) in [https://github.com/arrow-kt/arrow/pull/3059](https://github.com/arrow-kt/arrow/pull/3059) - Update versions of several libraries by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3017](https://github.com/arrow-kt/arrow/pull/3017) - Add merge builder for raise by [@​kyay10](https://github.com/kyay10) in [https://github.com/arrow-kt/arrow/pull/3061](https://github.com/arrow-kt/arrow/pull/3061) - Update all dependencies by [@​renovate](https://github.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3065](https://github.com/arrow-kt/arrow/pull/3065) - Update dependency gradle to v8.2 by [@​renovate](https://github.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3070](https://github.com/arrow-kt/arrow/pull/3070) - Fix warnings of single-subclass sealed classes by [@​jooohn](https://github.com/jooohn) in [https://github.com/arrow-kt/arrow/pull/3067](https://github.com/arrow-kt/arrow/pull/3067) - KDoc for `Raise#raise`, `Raise#ensure` and `Raise#ensureNotNull` by [@​ILIYANGERMANOV](https://github.com/ILIYANGERMANOV) in [https://github.com/arrow-kt/arrow/pull/3038](https://github.com/arrow-kt/arrow/pull/3038) - Fix text repetition in EffectScope's deprecation message by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3072](https://github.com/arrow-kt/arrow/pull/3072) - Introduce `NonEmptyCollection` by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3068](https://github.com/arrow-kt/arrow/pull/3068) - Set up Spotless by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3075](https://github.com/arrow-kt/arrow/pull/3075) - Update all dependencies by [@​renovate](https://github.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3079](https://github.com/arrow-kt/arrow/pull/3079) - Add option to disable `inline` when using `@optics` by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3078](https://github.com/arrow-kt/arrow/pull/3078) - Update JS versions in `yarn.lock` by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3084](https://github.com/arrow-kt/arrow/pull/3084) - Enable Automatic Modules for JVM by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3071](https://github.com/arrow-kt/arrow/pull/3071) - Serialization module by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3077](https://github.com/arrow-kt/arrow/pull/3077) - Add missing docs for `Raise` operations by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3082](https://github.com/arrow-kt/arrow/pull/3082) - Add mapOrAccumulate extension in RaiseAccumulate by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3086](https://github.com/arrow-kt/arrow/pull/3086) - Additional tests for `copy` in Optics by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3089](https://github.com/arrow-kt/arrow/pull/3089) - Apply Gradle Versioning in top project by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3092](https://github.com/arrow-kt/arrow/pull/3092) - Add missing Versioning plug-in to `arrow-core-retrofit` by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3093](https://github.com/arrow-kt/arrow/pull/3093) - Update `arrow-gradle-config` to 0.12-rc.4 by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3094](https://github.com/arrow-kt/arrow/pull/3094) - MemoizedDeepRecursiveFunction by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3091](https://github.com/arrow-kt/arrow/pull/3091) - Add reset and barrierAction to CyclicBarrier. by [@​HSAR](https://github.com/HSAR) in [https://github.com/arrow-kt/arrow/pull/3055](https://github.com/arrow-kt/arrow/pull/3055) - \[HOTFIX] Fix main publish by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3095](https://github.com/arrow-kt/arrow/pull/3095) #### New Contributors - [@​DeoTimeTheGithubUser](https://github.com/DeoTimeTheGithubUser) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3036](https://github.com/arrow-kt/arrow/pull/3036) - [@​vladd-g](https://github.com/vladd-g) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3060](https://github.com/arrow-kt/arrow/pull/3060) - [@​yoxjames](https://github.com/yoxjames) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3052](https://github.com/arrow-kt/arrow/pull/3052) - [@​kyay10](https://github.com/kyay10) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3059](https://github.com/arrow-kt/arrow/pull/3059) - [@​jooohn](https://github.com/jooohn) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3067](https://github.com/arrow-kt/arrow/pull/3067) - [@​ILIYANGERMANOV](https://github.com/ILIYANGERMANOV) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3038](https://github.com/arrow-kt/arrow/pull/3038) - [@​HSAR](https://github.com/HSAR) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3055](https://github.com/arrow-kt/arrow/pull/3055) **Full Changelog**: arrow-kt/arrow@1.2.0-RC...1.2.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/sindrenm/android-project-template). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi41LjMiLCJ1cGRhdGVkSW5WZXIiOiIzNi41LjMiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=-->
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.arrow-kt:arrow-fx-coroutines](https://github.com/arrow-kt/arrow) | `1.1.3` -> `1.2.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.arrow-kt:arrow-fx-coroutines/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.arrow-kt:arrow-fx-coroutines/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.arrow-kt:arrow-fx-coroutines/1.1.3/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.arrow-kt:arrow-fx-coroutines/1.1.3/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [io.arrow-kt:arrow-optics-ksp-plugin](https://github.com/arrow-kt/arrow) | `1.1.3` -> `1.2.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.arrow-kt:arrow-optics-ksp-plugin/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.arrow-kt:arrow-optics-ksp-plugin/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.arrow-kt:arrow-optics-ksp-plugin/1.1.3/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.arrow-kt:arrow-optics-ksp-plugin/1.1.3/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [io.arrow-kt:arrow-optics](https://github.com/arrow-kt/arrow) | `1.1.3` -> `1.2.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.arrow-kt:arrow-optics/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.arrow-kt:arrow-optics/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.arrow-kt:arrow-optics/1.1.3/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.arrow-kt:arrow-optics/1.1.3/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [io.arrow-kt:arrow-core](https://github.com/arrow-kt/arrow) | `1.1.3` -> `1.2.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.arrow-kt:arrow-core/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.arrow-kt:arrow-core/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.arrow-kt:arrow-core/1.1.3/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.arrow-kt:arrow-core/1.1.3/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [io.arrow-kt:arrow-stack](https://github.com/arrow-kt/arrow) | `1.1.3` -> `1.2.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.arrow-kt:arrow-stack/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.arrow-kt:arrow-stack/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.arrow-kt:arrow-stack/1.1.3/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.arrow-kt:arrow-stack/1.1.3/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### ⚠ Dependency Lookup Warnings ⚠ Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>arrow-kt/arrow (io.arrow-kt:arrow-fx-coroutines)</summary> ### [`v1.2.0`](https://github.com/arrow-kt/arrow/releases/tag/1.2.0) [Compare Source](https://github.com/arrow-kt/arrow/compare/1.1.5...1.2.0) ##### What's Changed - Add CNAME file to Dokka output by [@​franciscodr](https://github.com/franciscodr) in [https://github.com/arrow-kt/arrow/pull/3029](https://github.com/arrow-kt/arrow/pull/3029) - Remove legacy site code by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3030](https://github.com/arrow-kt/arrow/pull/3030) - Update README by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3033](https://github.com/arrow-kt/arrow/pull/3033) - Cancel previous PR action on new commit by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3032](https://github.com/arrow-kt/arrow/pull/3032) - Remove legacy script files by [@​franciscodr](https://github.com/franciscodr) in [https://github.com/arrow-kt/arrow/pull/3034](https://github.com/arrow-kt/arrow/pull/3034) - Ensure optics type with "data" modifier is a class by [@​DeoTimeTheGithubUser](https://github.com/DeoTimeTheGithubUser) in [https://github.com/arrow-kt/arrow/pull/3036](https://github.com/arrow-kt/arrow/pull/3036) - Update all dependencies (major) by [@​renovate](https://github.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3042](https://github.com/arrow-kt/arrow/pull/3042) - Remove test dependency from Arrow Fx by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3046](https://github.com/arrow-kt/arrow/pull/3046) - Bump Kotlin, KSP and coroutines version by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3047](https://github.com/arrow-kt/arrow/pull/3047) - fix mapIndexed when collecting multiple times by [@​hoc081098](https://github.com/hoc081098) in [https://github.com/arrow-kt/arrow/pull/3056](https://github.com/arrow-kt/arrow/pull/3056) - Update versions by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3058](https://github.com/arrow-kt/arrow/pull/3058) - optics ksp plugin: fixed handling of variance ([#​3057](https://github.com/arrow-kt/arrow/issues/3057)) by [@​vladd-g](https://github.com/vladd-g) in [https://github.com/arrow-kt/arrow/pull/3060](https://github.com/arrow-kt/arrow/pull/3060) - Fixes recover inconsistency with raise DSL on types other than Either by [@​yoxjames](https://github.com/yoxjames) in [https://github.com/arrow-kt/arrow/pull/3052](https://github.com/arrow-kt/arrow/pull/3052) - Change NonEmptySet type parameter name from T to A by [@​franciscodr](https://github.com/franciscodr) in [https://github.com/arrow-kt/arrow/pull/3062](https://github.com/arrow-kt/arrow/pull/3062) - Add withError and (Eager)Effect.mapError by [@​kyay10](https://github.com/kyay10) in [https://github.com/arrow-kt/arrow/pull/3059](https://github.com/arrow-kt/arrow/pull/3059) - Update versions of several libraries by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3017](https://github.com/arrow-kt/arrow/pull/3017) - Add merge builder for raise by [@​kyay10](https://github.com/kyay10) in [https://github.com/arrow-kt/arrow/pull/3061](https://github.com/arrow-kt/arrow/pull/3061) - Update all dependencies by [@​renovate](https://github.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3065](https://github.com/arrow-kt/arrow/pull/3065) - Update dependency gradle to v8.2 by [@​renovate](https://github.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3070](https://github.com/arrow-kt/arrow/pull/3070) - Fix warnings of single-subclass sealed classes by [@​jooohn](https://github.com/jooohn) in [https://github.com/arrow-kt/arrow/pull/3067](https://github.com/arrow-kt/arrow/pull/3067) - KDoc for `Raise#raise`, `Raise#ensure` and `Raise#ensureNotNull` by [@​ILIYANGERMANOV](https://github.com/ILIYANGERMANOV) in [https://github.com/arrow-kt/arrow/pull/3038](https://github.com/arrow-kt/arrow/pull/3038) - Fix text repetition in EffectScope's deprecation message by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3072](https://github.com/arrow-kt/arrow/pull/3072) - Introduce `NonEmptyCollection` by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3068](https://github.com/arrow-kt/arrow/pull/3068) - Set up Spotless by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3075](https://github.com/arrow-kt/arrow/pull/3075) - Update all dependencies by [@​renovate](https://github.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3079](https://github.com/arrow-kt/arrow/pull/3079) - Add option to disable `inline` when using `@optics` by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3078](https://github.com/arrow-kt/arrow/pull/3078) - Update JS versions in `yarn.lock` by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3084](https://github.com/arrow-kt/arrow/pull/3084) - Enable Automatic Modules for JVM by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3071](https://github.com/arrow-kt/arrow/pull/3071) - Serialization module by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3077](https://github.com/arrow-kt/arrow/pull/3077) - Add missing docs for `Raise` operations by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3082](https://github.com/arrow-kt/arrow/pull/3082) - Add mapOrAccumulate extension in RaiseAccumulate by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3086](https://github.com/arrow-kt/arrow/pull/3086) - Additional tests for `copy` in Optics by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3089](https://github.com/arrow-kt/arrow/pull/3089) - Apply Gradle Versioning in top project by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3092](https://github.com/arrow-kt/arrow/pull/3092) - Add missing Versioning plug-in to `arrow-core-retrofit` by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3093](https://github.com/arrow-kt/arrow/pull/3093) - Update `arrow-gradle-config` to 0.12-rc.4 by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3094](https://github.com/arrow-kt/arrow/pull/3094) - MemoizedDeepRecursiveFunction by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/3091](https://github.com/arrow-kt/arrow/pull/3091) - Add reset and barrierAction to CyclicBarrier. by [@​HSAR](https://github.com/HSAR) in [https://github.com/arrow-kt/arrow/pull/3055](https://github.com/arrow-kt/arrow/pull/3055) - \[HOTFIX] Fix main publish by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3095](https://github.com/arrow-kt/arrow/pull/3095) ##### New Contributors - [@​DeoTimeTheGithubUser](https://github.com/DeoTimeTheGithubUser) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3036](https://github.com/arrow-kt/arrow/pull/3036) - [@​vladd-g](https://github.com/vladd-g) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3060](https://github.com/arrow-kt/arrow/pull/3060) - [@​yoxjames](https://github.com/yoxjames) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3052](https://github.com/arrow-kt/arrow/pull/3052) - [@​kyay10](https://github.com/kyay10) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3059](https://github.com/arrow-kt/arrow/pull/3059) - [@​jooohn](https://github.com/jooohn) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3067](https://github.com/arrow-kt/arrow/pull/3067) - [@​ILIYANGERMANOV](https://github.com/ILIYANGERMANOV) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3038](https://github.com/arrow-kt/arrow/pull/3038) - [@​HSAR](https://github.com/HSAR) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3055](https://github.com/arrow-kt/arrow/pull/3055) **Full Changelog**: arrow-kt/arrow@1.2.0-RC...1.2.0 ### [`v1.1.5`](https://github.com/arrow-kt/arrow/releases/tag/1.1.5) [Compare Source](https://github.com/arrow-kt/arrow/compare/1.1.4...1.1.5) #### What's Changed - Remove `test` modules by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/2874](https://github.com/arrow-kt/arrow/pull/2874) - Mention Arrow 2.0 in README by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/2878](https://github.com/arrow-kt/arrow/pull/2878) - Prisms for Either by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/2877](https://github.com/arrow-kt/arrow/pull/2877) - Test 1.8.0 on CI by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2864](https://github.com/arrow-kt/arrow/pull/2864) - Implement 'align' using 'buildList' by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/2886](https://github.com/arrow-kt/arrow/pull/2886) - Improve debugging experience of leaked shift calls by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2884](https://github.com/arrow-kt/arrow/pull/2884) - Fix knitCheck & re-add check by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2887](https://github.com/arrow-kt/arrow/pull/2887) **Full Changelog**: arrow-kt/arrow@1.1.4...1.1.5 ### [`v1.1.4`](https://github.com/arrow-kt/arrow/releases/tag/1.1.4) [Compare Source](https://github.com/arrow-kt/arrow/compare/1.1.3...1.1.4) #### What's Changed - \[2743] Migrate internal use of CircuitBreaker double to duration by [@​mjmoore](https://github.com/mjmoore) in [https://github.com/arrow-kt/arrow/pull/2748](https://github.com/arrow-kt/arrow/pull/2748) - Fix typo by [@​valery1707](https://github.com/valery1707) in [https://github.com/arrow-kt/arrow/pull/2824](https://github.com/arrow-kt/arrow/pull/2824) - Make the server disconnect test more general by [@​lukasz-kalnik-gcx](https://github.com/lukasz-kalnik-gcx) in [https://github.com/arrow-kt/arrow/pull/2822](https://github.com/arrow-kt/arrow/pull/2822) - Update NonEmptyList.fromList deprecation to suggest `toOption()` instead by [@​StylianosGakis](https://github.com/StylianosGakis) in [https://github.com/arrow-kt/arrow/pull/2832](https://github.com/arrow-kt/arrow/pull/2832) - Improve Either.getOrHandle() docs by [@​lukasz-kalnik-gcx](https://github.com/lukasz-kalnik-gcx) in [https://github.com/arrow-kt/arrow/pull/2833](https://github.com/arrow-kt/arrow/pull/2833) - Correct `addressStrees` -> `addressStreet` in optics documentation by [@​vikrem](https://github.com/vikrem) in [https://github.com/arrow-kt/arrow/pull/2836](https://github.com/arrow-kt/arrow/pull/2836) - Arrow Fx: deprecate Platform#composeError, never and unit() by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2837](https://github.com/arrow-kt/arrow/pull/2837) - Backport Optics KSP plugin NPE on multiplatform fix by [@​cvb941](https://github.com/cvb941) in [https://github.com/arrow-kt/arrow/pull/2840](https://github.com/arrow-kt/arrow/pull/2840) - Refactor - [#​2812](https://github.com/arrow-kt/arrow/issues/2812) sequence separate performance by [@​Khepu](https://github.com/Khepu) in [https://github.com/arrow-kt/arrow/pull/2818](https://github.com/arrow-kt/arrow/pull/2818) - Use `super` equals and hashCode overrides for NonEmptyList by [@​RusticFlare](https://github.com/RusticFlare) in [https://github.com/arrow-kt/arrow/pull/2825](https://github.com/arrow-kt/arrow/pull/2825) - Resource API deprecation, and preparation for 2.x.x. & back port improvements by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2847](https://github.com/arrow-kt/arrow/pull/2847) - introduce iterable.toNonEmptyListOrNone() by [@​myuwono](https://github.com/myuwono) in [https://github.com/arrow-kt/arrow/pull/2843](https://github.com/arrow-kt/arrow/pull/2843) - \[PROPOSAL] Either API deprecation, and preparation for 2.x.x by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2830](https://github.com/arrow-kt/arrow/pull/2830) - Use major versions in GitHub Actions by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/2849](https://github.com/arrow-kt/arrow/pull/2849) - Weaken Either monoid dependencies to only require a semigroup on left by [@​mjvmroz](https://github.com/mjvmroz) in [https://github.com/arrow-kt/arrow/pull/2845](https://github.com/arrow-kt/arrow/pull/2845) - Do not reuse the name of the file in Optics KSP by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/2850](https://github.com/arrow-kt/arrow/pull/2850) - Additional deprecations, and backports for JVM by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2856](https://github.com/arrow-kt/arrow/pull/2856) - Update various versions by [@​serras](https://github.com/serras) in [https://github.com/arrow-kt/arrow/pull/2852](https://github.com/arrow-kt/arrow/pull/2852) - Add CountDownLatch by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2854](https://github.com/arrow-kt/arrow/pull/2854) - Add CyclicBarrier by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2857](https://github.com/arrow-kt/arrow/pull/2857) - Temp rollback error handling deprecations until 1.2.x by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2858](https://github.com/arrow-kt/arrow/pull/2858) - Setup Kover as test coverage tool by [@​MarkMarkyMarkus](https://github.com/MarkMarkyMarkus) in [https://github.com/arrow-kt/arrow/pull/2793](https://github.com/arrow-kt/arrow/pull/2793) - Fix Monad.either binary combat by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2867](https://github.com/arrow-kt/arrow/pull/2867) - Backport: MPP No Trace by [@​nomisRev](https://github.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/2869](https://github.com/arrow-kt/arrow/pull/2869) #### New Contributors - [@​mjmoore](https://github.com/mjmoore) made their first contribution in [https://github.com/arrow-kt/arrow/pull/2748](https://github.com/arrow-kt/arrow/pull/2748) - [@​valery1707](https://github.com/valery1707) made their first contribution in [https://github.com/arrow-kt/arrow/pull/2824](https://github.com/arrow-kt/arrow/pull/2824) - [@​lukasz-kalnik-gcx](https://github.com/lukasz-kalnik-gcx) made their first contribution in [https://github.com/arrow-kt/arrow/pull/2822](https://github.com/arrow-kt/arrow/pull/2822) - [@​StylianosGakis](https://github.com/StylianosGakis) made their first contribution in [https://github.com/arrow-kt/arrow/pull/2832](https://github.com/arrow-kt/arrow/pull/2832) - [@​vikrem](https://github.com/vikrem) made their first contribution in [https://github.com/arrow-kt/arrow/pull/2836](https://github.com/arrow-kt/arrow/pull/2836) - [@​cvb941](https://github.com/cvb941) made their first contribution in [https://github.com/arrow-kt/arrow/pull/2840](https://github.com/arrow-kt/arrow/pull/2840) - [@​RusticFlare](https://github.com/RusticFlare) made their first contribution in [https://github.com/arrow-kt/arrow/pull/2825](https://github.com/arrow-kt/arrow/pull/2825) - [@​mjvmroz](https://github.com/mjvmroz) made their first contribution in [https://github.com/arrow-kt/arrow/pull/2845](https://github.com/arrow-kt/arrow/pull/2845) - [@​MarkMarkyMarkus](https://github.com/MarkMarkyMarkus) made their first contribution in [https://github.com/arrow-kt/arrow/pull/2793](https://github.com/arrow-kt/arrow/pull/2793) **Full Changelog**: arrow-kt/arrow@1.1.3...1.1.4-rc.3 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/elide-dev/elide). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMTEuMCIsInRhcmdldEJyYW5jaCI6InYzIn0=-->
See Issue: #3051
This PR is a work in progress naive fix for the issue highlighted above. It works in the sense that tests pass but I am guessing this may have problems I am not fully aware of. The idea here was to prevent
bind()
inside therecover(...)
block from using theIorRaise
scope and instead use theRaise<Error>
scope.IorRaise
has it's own scope to managecombine(...)
for dealing withIor.Both
A consequence of this "fix" is that
recover
has no concept ofcombine
. Personally, I don't find this to be too odd. You are essentially creating a "sub raise" and recovering from anything that goes wrong. This does mean that the left value on anIor.Both
is dropped inside therecover
block. However, I didn't want to start totally changing the API and figured this PR could at least serve as a discussion point for how this could be resolved. I can see adding special versions of the recover function to allow for handling Both values and combining them but wanted to keep this simple for now.