-
-
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 helper method toFreeT
to Free
#2724
Conversation
Thanks @jcouyang! It looks like scalafmt is complaining about some whitespace. If you run |
@ceedubs I ran |
Codecov Report
@@ Coverage Diff @@
## master #2724 +/- ##
==========================================
+ Coverage 95.13% 95.14% +0.01%
==========================================
Files 365 365
Lines 6798 6818 +20
Branches 296 302 +6
==========================================
+ Hits 6467 6487 +20
Misses 331 331
Continue to review full report at Codecov.
|
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.
👍 thanks @jcouyang!
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.
Looks good :)
new (S ~> FreeT[S, G, ?]) { | ||
def apply[B](fa: S[B]): FreeT[S, G, B] = FreeT.liftF(fa) | ||
} | ||
}(FreeT.catsFreeMonadForFreeT[S, G]) |
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.
This can probably be simplified as
foldMap( λ[S ~> FreeT[S, G, ?]](FreeT.lift(_))
@@ -45,6 +45,10 @@ class FreeSuite extends CatsSuite { | |||
rr.toString.length should be > 0 | |||
} | |||
|
|||
test("toFreeT is stack-safe") { |
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.
Can we move this one down to be grouped with the other stack safety test?
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.
Thanks! I added some minor comments
thanks @kailuowang, comment addressed, please have a look :) |
so just |
🤔 not sure why it works now...looks like λ magic anyway, removing the explicit paramter in mapK too |
hi @kailuowang can you please help review the latest change? |
Hey @jcouyang, sorry for not getting to this earlier. Kai had his phone stolen on vacation and I've been away as well. Anyway, this looks good to me :) Will merge this soon! |
🙀 oh no, sorry to hear that |
@jcouyang thanks a lot! as Luka mentioned, sorry about the delay. |
so any
Free[S, A]
can be converted toFreeT[S, G, A]
if there is an Applicative instance of G