-
Notifications
You must be signed in to change notification settings - Fork 561
Add Lift{Value,Kind} instances for Resource
#4478
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
base: series/3.x
Are you sure you want to change the base?
Conversation
|
for reasons I do not understand, the implicits for |
| libraryDependencies ++= Seq( | ||
| "org.typelevel" %%% "cats-core" % CatsVersion | ||
| "org.typelevel" %%% "cats-core" % CatsVersion, | ||
| "org.typelevel" %%% "cats-mtl" % CatsMtlVersion |
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 is a meaningful extension of the dependency surface area. It's not something I would rule out, since most people depend on core or std, but it's still not something to do lightly.
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 agree; however, I thought having a PR would be more compelling than just opening an issue for it
| implicit def catsEffectLiftValueForResource[F[_]]( | ||
| implicit F: Applicative[F]): LiftValue[F, Resource[F, *]] = | ||
| liftValueImpl(F) |
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.
These two implicits should be inverted. The Applicative constraint is strictly less restrictive than MonadCancel, and so it should be consulted second. This means that you put the MonadCancel-constrained implicit in the 0 priority and Applicative in 1.
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! that makes sense now that you've said it, though I confess I don't understand why doing it the wrong way makes it not compile
| import org.scalacheck.{Arbitrary, Gen} | ||
| import munit.DisciplineSuite | ||
|
|
||
| class ResourceSuite extends DisciplineSuite { |
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.
Fwiw, there are already resource tests in core, though I don't object to having a few more in laws.
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 believe the issue is that these tests depend on testkit (for PureConc), which core's tests do not have access to
ca64e91 to
68636bf
Compare
|
test failure seems spurious |
|
could someone with permissions please rerun the failed and cancelled ci jobs? |
No description provided.