-
-
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 ApplicativeThrow
and MonadThrow
to cats package object (from cats-effect)
#3696
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3696 +/- ##
=======================================
Coverage 90.23% 90.23%
=======================================
Files 391 391
Lines 8861 8861
Branches 242 242
=======================================
Hits 7996 7996
Misses 865 865 |
It'd also be kinda nice if we could add a object MonadThrow {
def apply[F[_]](implicit ev: MonadThrow[F]): MonadThrow[F] = ev
} but wasn't sure where we might put that |
If/when this is released I'd suggest we remove these from CE3 and change the ones in CE2 to be aliases for these. |
Good idea - I think it could either go directly below the alias or in a |
Yeah, I wondered if putting it in the same file as |
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 like it 👍
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 like this a lot. So much better than having it in Cats Effect
I noticed that the
ApplicativeThrow
andMonadThrow
type aliases had been added to cats-effect:https://github.com/typelevel/cats-effect/blob/series/2.x/core/shared/src/main/scala/cats/effect/package.scala#L41-L43
I felt that it made more sense for it to be cats as
ApplicativeError
andMonadError
are in cats rather than cats-effect.Also, it seems like
ApplicativeThrow
has erroneously had an unusedA
type param added, so I figured it was best to remove it. I'm not sure if that will clash or cause problems if bothcats._
andcats.effect._
are imported. I'll open a separate PR against cats-effect 2.x branch to remove theA
As an aside, I tried running this task but it failed on master as well as my PR, but the code all seems to be formatted correctly.