@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
.
- Type parameters:
- F
the higher-kinded type of a polymorphic effect
- R
the type of ZIO environment
- Companion:
- object
class Object
trait Matchable
class Any