Skip to content
eff zio extension
Scala
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
jvm/src/test/scala/com/github/takayahilton/eff/zio
project
shared/src/main/scala/com/github/takayahilton/eff/zio
.gitignore
.scalafmt.conf
.travis.yml
LICENSE
README.md
build.sbt
version.sbt

README.md

eff-zio

Build Status Maven Central

This library is eff extension for ZIO effects.

Installation

// check maven badge above for latest version
libraryDependencies += "com.github.takayahilton" %% "eff-zio" % "0.1.2"

// to write types like Reader[String, ?]
addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.10.0")

// to get types like Reader[String, ?] (with more than one type parameter) correctly inferred for scala 2.11.11+ and 2.12.x
scalacOptions += "-Ypartial-unification"

// to get types like Reader[String, ?] (with more than one type parameter) correctly inferred for scala 2.11.9 and before
// you can use the [Typelevel Scala compiler](http://typelevel.org/scala)
scalaOrganization in ThisBuild := "org.typelevel"

Usage

import com.github.takayahilton.eff.zio._
import org.atnos.eff._
import org.atnos.eff.all._
import org.atnos.eff.syntax.all._
import zio.{DefaultRuntime, UIO}

object Runtime extends DefaultRuntime

type S1 = Fx.fx2[UIO, Option]

def action[R: _uio: _option]: Eff[R, Int] =
  for {
    a <- succeedLazy(10)
    b <- succeedLazy(20)
  } yield a + b

val zio = action[S1].runOption.runAsync

Runtime.unsafeRun(zio) //Some(30)
You can’t perform that action at this time.