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

Recommend Either.getOrElse for handleError instead of recover #2986

Merged
merged 3 commits into from
Mar 21, 2023

Conversation

nomisRev
Copy link
Member

Recommending getOrElse for handleError gives a better flowing of types than using Either<Nothing, A>,
and is more in line with the changes made in Removes autobind DSL in favor of getOrElse.

recover is a replacement for handleErrorWith and using it for handleError (sadly) results in poor inference, because @BuilderInference doesn't infer Nothing when EE is not used.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 17, 2023

Kover Report

File Coverage [56.31%]
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Either.kt 56.31%
Total Project Coverage 42.68%

@franciscodr
Copy link
Collaborator

Is there anything pending in this PR? Or are we ok with merging it?

@nomisRev nomisRev merged commit b6a00df into main Mar 21, 2023
@nomisRev nomisRev deleted the replacewith-handleerror-getorelse branch March 21, 2023 08:00
@nomisRev
Copy link
Member Author

If anything from me is open, and 2x approved feel free to merge @franciscodr 😉

@franciscodr
Copy link
Collaborator

If anything from me is open, and 2x approved feel free to merge @franciscodr 😉

Thanks, @nomisRev I will do it! 😄

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.

3 participants