Skip to content

Conversation

@NthPortal
Copy link
Contributor

No description provided.

@NthPortal NthPortal marked this pull request as draft August 25, 2025 19:57
@NthPortal
Copy link
Contributor Author

for reasons I do not understand, the implicits for LiftKind and LiftValue are both being considered when searching for implicits for LiftValue, leading to ambiguous implicits. I'm fairly sure I'm doing the low priority implicits thing correctly

libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-core" % CatsVersion
"org.typelevel" %%% "cats-core" % CatsVersion,
"org.typelevel" %%% "cats-mtl" % CatsMtlVersion
Copy link
Member

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.

Copy link
Contributor Author

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

Comment on lines 1280 to 1282
implicit def catsEffectLiftValueForResource[F[_]](
implicit F: Applicative[F]): LiftValue[F, Resource[F, *]] =
liftValueImpl(F)
Copy link
Member

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.

Copy link
Contributor Author

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 {
Copy link
Member

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.

Copy link
Contributor Author

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

@NthPortal NthPortal marked this pull request as ready for review August 26, 2025 03:19
@NthPortal
Copy link
Contributor Author

test failure seems spurious

@NthPortal
Copy link
Contributor Author

could someone with permissions please rerun the failed and cancelled ci jobs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants