@Kai I getting:
@ t(IO(1))
cmd30.sc:1: type mismatch;
found : izumi.functional.bio.PredefinedHelper.Predefined.Of[izumi.functional.bio.BIOAsync3[zio.ZIO]]
(which expands to) izumi.functional.bio.BIOAsync3[zio.ZIO]{type IsPredefined = izumi.functional.bio.PredefinedHelper.Predefined}
required: izumi.functional.bio.BIOAsync[[+E, +A]zio.ZIO[R,E,A]]
(which expands to) izumi.functional.bio.BIOAsync3[[-R, +E, +A]zio.ZIO[R,E,A]]
val res30 = t(IO(1))
Is there any workaround?
scalacOptions += "-Ypartial-unification"
scalacOptions += "-Xsource:2.13”
No, it's not
@ t[zio.IO, cats.effect.IO](cats.effect.IO(1))
cmd30.sc:1: wrong number of type parameters for method t: [F[+_, +_], R[_], B](t: R[B])(implicit evidence$1: izumi.functional.bio.BIOAsync[F], implicit evidence$2: izumi.functional.bio.BIOFork[F], implicit evidence$3: izumi.functional.bio.BIO[F], implicit evidence$4: cats.effect.Effect[R], implicit cs: cats.effect.ContextShift[R])F[Throwable,B]
val res30 = t[zio.IO, cats.effect.IO](cats.effect.IO(1))
^
Compilation Failed
I'm on 2.13.2 and it still very strange :]
distage-testkit
& distage-framework-docker
- https://github.com/7mind/izumi/releases/tag/v0.10.9 - should make memoization behavior far better & more consistent within your project (and make it obvious through logs). Note: you can now turn off all logging incl. config loading in testkit by setting TestConfig#logLevel
Hey guys, I have another problem, I'm trying to use cats.IO resource in MainPlugin,
but I getting this error
Suppressed: izumi.distage.model.exceptions.IncompatibleEffectTypesException: Incompatible effect types: Can't execute effect in `λ %0 → cats.effect.IO[+0]` which is neither Identity, nor a subtype of the effect that Provisioner was launched in: `λ %1 → zio.ZIO[-Any,+Throwable,+1]`
Clarification:
- To execute `.fromEffect` and `.fromResource` bindings for effects other than `Identity` you need to use `Injector.produceF` method with F type corresponding to the type of effects/resources you inject
- Subtype type constructors are allowed. e.g. when using ZIO you can execute actions with type IO[Nothing, ?] when running in IO[Throwable, ?]
at izumi.distage.provisioning.PlanInterpreterDefaultRuntimeImpl.$anonfun$verifyEffectType$1(PlanInterpreterDefaultRuntimeImpl.scala:215)
at izumi.distage.model.effect.DIEffect.$anonfun$traverse_$2(DIEffect.scala:44)
at zio.internal.FiberContext.evaluateNow(FiberContext.scala:844)
... 19 more
Caused by: zio.Cause$FiberTrace: Fiber failed.
That's because
make[Transactor[F[Throwable, ?]]].fromResource[TransactorResource[F[Throwable, ?]]]
I can make this with zio.IO, but if I do
//make[Transactor[R]].fromResource[TransactorResourceCats[R]]
where R == cats.IO
I got the error from above.
Is it possible to get cats.IO Resource effect with IO{], rather then with F[,_]: TagKK : BIO?
@Jacke Yes, but you will need to move all other components to cats.effect.IO too. To change the effect type
in app: change the RoleAppLauncher's effect in https://github.com/7mind/distage-example/blob/develop/src/main/scala/leaderboard/LeaderboardRole.scala#L121 - inherit from RoleAppLauncher.LauncherF[cats.effect.IO]
instead of LauncherBIO[zio.IO]
in tests change the testkit's effect in https://github.com/7mind/distage-example/blob/develop/src/test/scala/leaderboard/tests.scala#L14 - inherit from DistageSpecScalatest[cats.effect.IO]
instead of DistageBIOEnvSpecScalatest[zio.IO]
When using Injector directly, not via distage-framework or distage-testkit, the effect type is determined by the type parameter passed to Injector#produceF
/#produceRunF
/#produceGetF
etc
You will need to move all components to the new effect type, only one effect type can be used at a time.
Hi guys, i'm trying to use injector directly via:
val myModules = CatsAppPlugin.modules.app[IO] ++
CatsAppPlugin.modules.repoProd[IO] ++
CatsModule ++
CatsAppPlugin.modules.configs ++
CatsAppPlugin.modules.api[IO] ++
CatsAppPlugin.modules.repoDummy[IO]
val plan = Injector().plan(myModules, Roots.Everything)
var ctx: Module[IO] = Injector().produce(myModules, Roots.Everything).unsafeGet().get[Module[IO]]
but I got an error
com.spread0x.http4s.service.UserServiceSpec *** ABORTED ***
izumi.distage.model.exceptions.ProvisioningException: Provisioner stopped after 1 instances, 5/64 operations failed:
- {type.izumi.distage.config.model.AppConfig} (CatsAppPlugin.scala:162), MissingInstanceException: Instance is not available in the object graph: {type.izumi.distage.config.model.AppConfig}.
Required by refs:
* {type.com.spread0x.config.PostgresCfg}
* {type.com.spread0x.config.PostgresPortCfg}
* {type.com.spread0x.config.ServerConfig}
How can I inject izumi.distage.config.model.AppConfig to fix the error?
com.spread0x.http4s.http.UserRoutesSpec *** ABORTED ***
izumi.distage.model.exceptions.ProvisioningException: Provisioner stopped after 1 instances, 4/65 operations failed:
- {type.org.http4s.client.Client[=λ %0 → IO[+0]]} (CatsAppPlugin.scala:86), IncompatibleEffectTypesException: Incompatible effect types: Can't execute effect in `λ %0 → cats.effect.IO[+0]` which is neither Identity, nor a subtype of the effect that Provisioner was launched in: `λ %0 → 0`
Hi all! I would like to ask about logstage with logback configuration.
Now I have json log in %msg
field with this setting: LogSinkLegacySlf4jImpl(LogstageCirceRenderingPolicy())
.
Is there some way to convert other slf4j logs (from other libraries) to logstage format to work with logback?
Or maybe you can tell me another way to use logstage api for json rendering with logback template
Or maybe you can tell me another way to use logstage api for json rendering with logback template
I'm not sure what exactly you want to do. We have logstage-sink-slf4j
which dumps logstage messages into slf4j. You may use it as a reference and implement your own logstage -> logback adapter
We also have logstage-adapter-slf4j
which works as an slf4j backend and forwards sl4j->logstage
LogSink
with google cloud logging APIs
Hey guys - what is the easiest way to change the output of the default IzLogger?
E.g. say instead of
[info] I 2020-08-21T11:00:23.984 (Main.scala:17) …foo.Main.runApplication [21:ioapp-compute-0] Pizza is great
I would like to have
[info] I 2020-08-21T11:00 (Main.scala:17) […foo.Main.runApplication] Pizza is great
How do do that?
0.10.19
, you can grab it once it gets on central https://dev.azure.com/7mind/izumi/_build/results?buildId=3089&view=results
trait OldOps[F[_]] {
//Monad Error
def old: F[Unit]
//....many methods
}
trait New[F[+_, +_]] {
def a: F[Throwable, Unit]
}
class NewImpl[F[+_, +_]: BIOMonadError](oldOps: OldOps[F]) extends New[F] {
def a: F[Throwable, Unit] = oldOps.old ???
}
addCompilerPlugin("org.typelevel" % "kind-projector" % "0.11.0" cross CrossVersion.full)