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

Add rethrowT method to EitherT #2655

Merged
merged 4 commits into from
Jan 9, 2019
Merged

Conversation

bplommer
Copy link
Contributor

@bplommer bplommer commented Dec 3, 2018

  • Add rethrowT method to EitherT: inverse of ApplicativeError#attemptT, analogous to MonadError#rethrow
  • Add/fix some tests
  • Document MonadErrorOps.reject and refactor to one line

@codecov-io
Copy link

codecov-io commented Dec 3, 2018

Codecov Report

Merging #2655 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
core/src/main/scala/cats/syntax/monadError.scala 100% <ø> (ø) ⬆️
core/src/main/scala/cats/data/EitherT.scala 97.91% <100%> (+0.01%) ⬆️
core/src/main/scala/cats/syntax/parallel.scala 70.58% <0%> (-9.42%) ⬇️
core/src/main/scala/cats/syntax/foldable.scala 100% <0%> (ø) ⬆️
core/src/main/scala/cats/syntax/reducible.scala 100% <0%> (ø) ⬆️
...estkit/src/main/scala/cats/tests/ListWrapper.scala 100% <0%> (ø)
...re/src/main/scala/cats/syntax/traverseFilter.scala 100% <0%> (ø)
core/src/main/scala/cats/data/Kleisli.scala 97.27% <0%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0bea999...4c8a4fe. Read the comment docs.

kubukoz
kubukoz previously approved these changes Jan 2, 2019
F.flatMap(fa) { a =>
pf.andThen(F.raiseError[A]).applyOrElse(a, (_: A) => fa)
}
F.flatMap(fa)(pf.andThen(F.raiseError[A]).applyOrElse(_, (_: A) => fa))
Copy link
Contributor

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.

Copy link
Contributor Author

@bplommer bplommer Jan 3, 2019

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.

@kailuowang kailuowang added this to the 1.6 milestone Jan 9, 2019
@kailuowang kailuowang merged commit 17293ed into typelevel:master Jan 9, 2019
@bplommer bplommer deleted the EitherT_syntax branch January 9, 2019 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants