-
-
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
Adding MonadRec for Kleisli #1279
Conversation
Current coverage is 90.56% (diff: 100%)@@ master #1279 diff @@
==========================================
Files 243 243
Lines 3285 3295 +10
Methods 3228 3236 +8
Messages 0 0
Branches 55 56 +1
==========================================
+ Hits 2975 2984 +9
- Misses 310 311 +1
Partials 0 0
|
|
||
def local[B](f: A => A)(fa: Kleisli[F, A, B]): Kleisli[F, A, B] = | ||
Kleisli(f.andThen(fa.run)) | ||
implicit def catsDataMonadRecForKleisli[F[_], A](implicit ev0: Monad[F], ev1: MonadRec[F]): MonadRec[Kleisli[F, A, ?]] = |
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 am curious why we need evidences for both Monad[F]
and MonadRec[F]
, since MonadRec[F]
extends Monad
?
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.
Should only need MonadRec[F]
since that implies Monad[F]
. And for single implicit parameters I believe the Cats style is:
catsDataMonadRecForKleisli[F[_], A](implicit F: Monad[F]): MonadRec[Kleisli[F, A, ?]] = ...
it might be worthwhile to wait on #1280 |
@zainab-ali could you review #1280 and see if you think I have correctly implemented this there? I did add tests (and stack safety tests). |
@zainab-ali shall we close this one given that #1280 is merged? |
Adding a
MonadRec
instance forKleisli