Skip to content
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

Backport Raise & error handlers #2912

Merged
merged 17 commits into from
Feb 6, 2023
Merged

Backport Raise & error handlers #2912

merged 17 commits into from
Feb 6, 2023

Conversation

nomisRev
Copy link
Member

@nomisRev nomisRev commented Jan 30, 2023

Migration Guide

See two proposal migration guides for Either & Effect.

Using Either

Replace either { }

  • Find + Replace arrow.core.continuations.either -> arrow.core.raise.either
  • Find + Replace arrow.core.continuations.ensureNotNull -> arrow.core.raise.ensureNotNull
  • Find + Replace arrow.core.computations.either -> arrow.core.raise.either
  • Find + Replace arrow.core.computations.ensureNotNull -> arrow.core.raise.ensureNotNull

Replace either.eager { }

  • Find + Replace arrow.core.continuations.either.eager -> arrow.core.raise.either
    => Might introduce duplicate import for arrow.core.raise.either
  • Find + Replace either.eager { -> either {

Replace EffectScope/EagerEffectScope

  • Find + Replace arrow.core.continuations.EffectScope -> arrow.core.raise.Raise
  • Find + Replace arrow.core.continuations.EagerEffectScope -> arrow.core.raise.Raise
  • Find + Replace arrow.core.continuations.ensureNotNull -> arrow.core.raise.ensureNotNull

Using Effect

  • Find + Replace arrow.core.continuations.Effect -> arrow.core.raise.Effect
  • Find + Replace arrow.core.continuations.ensureNotNull -> arrow.core.raise.ensureNotNull

    => Requires manually adding missing imports for fold, error handlers, and all Effect methods since they're replaced by extension functions.

Using EagerEffect

  • Find + Replace arrow.core.continuations.EagerEffect -> arrow.core.raise.EagerEffect
  • Find + Replace arrow.core.continuations.ensureNotNull -> arrow.core.raise.ensureNotNull

    => Requires manually adding missing imports for fold, error handlers, and all EagerEffect methods since they're replaced by extension functions.

@nomisRev nomisRev added the 1.2.0 Tickets belonging to 1.1.2 label Jan 30, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jan 31, 2023

Kover Report

File Coverage [51.91%]
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Either.kt 65.12%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Option.kt 44.98%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/either.kt 50.00%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/eval.kt 50.00%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/nullable.kt 70.00%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/option.kt 0.00%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/result.kt 50.00%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/EagerEffect.kt 38.46%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/EagerEffectScope.kt 56.52%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/Effect.kt 64.76%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/EffectScope.kt 74.19%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/either.kt 100.00%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/ior.kt 95.35%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/nullable.kt 68.75%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/option.kt 72.73%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/result.kt 33.33%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/raise/Builders.kt 43.14%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/raise/Effect.kt 50.00%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/raise/ErrorHandlers.kt 0.00%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/raise/Fold.kt 57.69%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/raise/Mappers.kt 3.33%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/raise/Raise.kt 23.91%
Total Project Coverage 42.65%

@nomisRev
Copy link
Member Author

nomisRev commented Feb 3, 2023

Task :arrow-core:compileTestKotlinJvm FAILED
1357
e: Could not load module Error module

😭

@nomisRev nomisRev changed the title [WIP] Backport Raise & error handlers Backport Raise & error handlers Feb 3, 2023
@nomisRev nomisRev marked this pull request as ready for review February 5, 2023 09:29
@nomisRev
Copy link
Member Author

nomisRev commented Feb 5, 2023

@serras can you please pay special attention to the contracts that I didn't forget anything 😅 🙏

Copy link
Member

@serras serras left a comment

Choose a reason for hiding this comment

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

Other than one contract, LGTM

Copy link
Collaborator

@franciscodr franciscodr left a comment

Choose a reason for hiding this comment

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

Thanks, @nomisRev!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.2.0 Tickets belonging to 1.1.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants