-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add rethrowT
method to EitherT
#2655
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2655 +/- ##
==========================================
+ Coverage 95.12% 95.13% +<.01%
==========================================
Files 363 365 +2
Lines 6704 6758 +54
Branches 289 297 +8
==========================================
+ Hits 6377 6429 +52
- Misses 327 329 +2
Continue to review full report at Codecov.
|
F.flatMap(fa) { a => | ||
pf.andThen(F.raiseError[A]).applyOrElse(a, (_: A) => fa) | ||
} | ||
F.flatMap(fa)(pf.andThen(F.raiseError[A]).applyOrElse(_, (_: A) => fa)) |
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.
Maybe I am biased, but I think the original version is more readable.
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'm not attached to this change - I made it to match the style of other utility methods, but I'm happy to revert it if the original version is preferred.
rethrowT
method to EitherT: inverse ofApplicativeError#attemptT
, analogous toMonadError#rethrow
MonadErrorOps.reject
and refactor to one line