Skip to content

Commit

Permalink
Fix DefaultModule.forZIOPlusCats getting selected without cats-effe…
Browse files Browse the repository at this point in the history
…ct on the classpath
  • Loading branch information
neko-kai committed Jun 28, 2023
1 parent 07fa0fd commit 4e6b8e7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ sealed trait LowPriorityDefaultModulesInstances1 extends LowPriorityDefaultModul
*
* Optional instance via https://blog.7mind.io/no-more-orphans.html
*
* This adds cats typeclass instances to the default effect module if you have cats-effect on classpath,
* otherwise the default effect module for ZIO will be [[forZIO]], containing BIO & QuasiIO, but not cats-effect instances.
* This adds cats typeclass instances to the default effect module if you have `cats-effect` and `zio-interop-cats` on classpath,
* otherwise the default effect module for ZIO will be [[forZIO]], containing BIO & QuasiIO instances, but no `cats-effect` instances.
*/
implicit def forZIOPlusCats[K[_, _, _], ZIO[_, _, _], R](
implicit def forZIOPlusCats[K[_[_], _], A[_[_]], ZIO[_, _, _], R](
implicit
@unused ensureInteropCatsOnClasspath: `zio.interop.ZManagedSyntax`[K],
@unused l: `zio.ZIO`[ZIO],
@unused ensureInteropCatsOnClasspath: `zio.interop.CatsIOResourceSyntax`[K],
@unused ensureCatsEffectOnClasspath: `cats.effect.kernel.Async`[A],
@unused isZIO: `zio.ZIO`[ZIO],
tagR: Tag[R],
): DefaultModule2[ZIO[R, _, _]] = {
DefaultModule(ZIOSupportModule[R] ++ ZIOCatsEffectInstancesModule[R])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import scala.annotation.unused
* only IFF you have cats-effect as a dependency without REQUIRING a cats-effect dependency.
*
* Optional instance via https://blog.7mind.io/no-more-orphans.html
*
* @note For Scala 2, it appears necessary for the type in question to be higher-kinded and
* be top-level to not provoke compile failures when it's not found.
*/

// cats-kernel
Expand Down Expand Up @@ -156,9 +159,9 @@ object `zio.ZIO` {
*
* Optional instance via https://blog.7mind.io/no-more-orphans.html
*/
final abstract class `zio.interop.ZManagedSyntax`[K[_, _, _]]
object `zio.interop.ZManagedSyntax` {
@inline implicit final def get: `zio.interop.ZManagedSyntax`[zio.interop.ZManagedSyntax] = null
final abstract class `zio.interop.CatsIOResourceSyntax`[K[_[_], _]]
object `zio.interop.CatsIOResourceSyntax` {
@inline implicit final def get: `zio.interop.CatsIOResourceSyntax`[zio.interop.CatsIOResourceSyntax] = null
}

//// monix-bio
Expand Down

0 comments on commit 4e6b8e7

Please sign in to comment.