jacke / smelly-ops   0.0.10

GNU General Public License v3.0 only GitHub

Cats & ZIO ops made implicitly / convert cats.effect.IO to zio.ZIO / convert zio.ZIO to cats.effect.IO

Scala versions: 2.13

smelly-ops

Cats & ZIO ops made implicitly

Add toZIO[Env] and toCatsEffect to cats.effect.IO/zio.ZIO instances where Env could be ZEnv, Any, ...

  implicit val R: zio.Runtime[zio.ZEnv] = zio.Runtime.default
  val CIOE: cats.effect.IO[Int] = cats.effect.IO(1*100)

  import SmellyOps._
  // convert IO to ZIO[Zenv] to IO to ZIO[Any] to IO and run in
  CIOE.toZIO[ZEnv].toCatsEffect.toZIO[Any].toCatsEffect.unsafeRunSync shouldBe 100

Install

    libraryDependencies ++= Seq(
      "com.github.jacke" %% "smelly" %  "0.0.10",
    )