@implicitNotFound("\nCould not find `CatsInterop` for effect ${F} and environment ${R}. `CatsInterop` can be one of the following:\n\n1) Non-contextual: default conversion between RIO and ${F}. A way to go for non-contextual effects (e.g. `cats.effect.IO`):\n\nimplicit val runtime: Runtime[${R}] = ???\nval dispatcher: Dispatcher[${F}] = ???\n\nimplicit val catsInterop: CatsInterop[${F}, ${R}] = CatsInterop.default(dispatcher)\n\n2) Contextual: injects ZIO environment into underlying effect. Can be used to share a context between ZIO and Kleisli-like effects:\n\ncase class Context(isAdmin: Boolean)\ntype Effect[A] = Kleisli[IO, Context, A]\n\nval dispatcher: Dispatcher[Effect] = ???\n\nimplicit val runtime: Runtime[Context] = ???\nimplicit val injectContext: InjectEnv[Effect, Context] = InjectEnv.kleisli\nimplicit val catsInterop: CatsInterop[Effect, Context] = CatsInterop.contextual(dispatcher)\n\n")
Interop between F
and zio.RIO. The combination of ToEffect and FromEffect.
Describes how zio.RIO can be created from a polymorphic effect F
.
Describes how a polymorphic effect F
can be created from zio.RIO.
- Type Params
- F
the higher-kinded type of a polymorphic effect
- R
the type of ZIO environment
- Companion
- object
@implicitNotFound("\nCould not find `FromEffect` for effect ${F} and environment ${R}. `FromEffect` can be one of the following:\n\n1) Non-contextual: derived automatically when `cats.effect.std.Dispatcher` is available in the implicit scope. A way to go for non-contextual effects (e.g. `cats.effect.IO`):\n\nimplicit val dispatcher: Dispatcher[${F}] = ???\n\nval fromEffect: FromEffect[${F}, ${R}] = implicitly // or an explicit call `FromEffect.forDispatcher`\n\n2) Contextual: injects ZIO environment into underlying effect. Can be used to share a context between ZIO and Kleisli-like effects:\n\ncase class Context(isAdmin: Boolean)\ntype Effect[A] = Kleisli[IO, Context, A]\n\nval dispatcher: Dispatcher[Effect] = ???\n\nimplicit val injectContext: InjectEnv[Effect, Context] = InjectEnv.kleisli\nimplicit val fromEffect: FromEffect[Effect, Context] = FromEffect.contextual(dispatcher)\n\n")
Describes how zio.RIO can be created from a polymorphic effect F
.
Describes how zio.RIO can be created from a polymorphic effect F
.
- Type Params
- F
the higher-kinded type of a polymorphic effect
- R
the type of ZIO environment
- Companion
- object
@implicitNotFound("\nCould not find `InjectEnv` for effect ${F} and environment ${R}. `InjectEnv` can be one of the following:\n\n1) Kleisli: injects given environment into the underlying effect in cats.data.Kleisli:\n\ncase class Context(isAdmin: Boolean)\ntype Eff[A] = Kleisli[IO, Context, A]\n\nimplicit val injectContext: InjectEnv[Eff, Context] = InjectEnv.kleisli\n\n2) Kleisli + lens: injects a zoomed value (via lens) of the given environment into the underlying effect in Kleisli:\n\ncase class Security(isAdmin: Boolean)\ncase class Context(security: Security, lastAccess: Instant)\n\ntype Eff[A] = Kleisli[IO, Security, A]\n\nimplicit val injectSecurity: InjectEnv[Eff, Context] =\n InjectEnv.kleisliLens(_.security, (ctx, security) => ctx.copy(security = security))\n\n")
Injects a given environment of type R
into the effect F
.
Injects a given environment of type R
into the effect F
.
- Type Params
- F
the higher-kinded type of a polymorphic effect
- R
the type of ZIO environment
- Companion
- object
@implicitNotFound("\nCould not find `ToEffect` for effect ${F} and environment ${R}. `ToEffect` can be one of the following:\n\n1) Non-contextual: derived automatically when `cats.effect.Async` and `Runtime` are available in the implicit scope. A way to go for non-contextual effects (e.g. `cats.effect.IO`):\n\nimplicit val async: Async[${F}] = ???\nimplicit val runtime: Runtime[${R}] = ???\nimplicit val toEffect: ToEffect[${F}, ${R}] = implicitly // or an explicit call `ToEffect.forAsync`\n\n2) Contextual: injects ZIO environment into underlying effect. Can be used to share a context between ZIO and Kleisli-like effects:\n\ncase class Context(isAdmin: Boolean)\ntype Effect[A] = Kleisli[IO, Context, A]\n\nval dispatcher: Dispatcher[Effect] = ???\n\nimplicit val runtime: Runtime[Context] = ???\nimplicit val injectContext: InjectEnv[Effect, Context] = InjectEnv.kleisli\nimplicit val toEffect: ToEffect[Effect, Context] = ToEffect.contextual\n\n")
Describes how a polymorphic effect F
can be created from zio.RIO.
Describes how a polymorphic effect F
can be created from zio.RIO.
- Type Params
- F
the higher-kinded type of a polymorphic effect
- R
the type of ZIO environment
- Companion
- object