Extensible effects are an alternative to monad transformers for computing with effects in a functional way. This library is based on the "free-er" monad and extensible effects described in Oleg Kiselyov in Freer monads, more extensible effects.
You can learn more in the User Guide:
- your first effects
- included effects:
Reader
,Writer
,Eval
,State
,... - create your own effects
- use Member implicits
- working with different effect stacks
- a tutorial similar to the cats' tutorial for Free monads
You can also check out this presentation at flatMap Oslo 2016 (slides).
You add eff
as an sbt dependency:
// check maven badge above for latest version
libraryDependencies += "org.atnos" %% "eff" % "5.1.0"
// 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"
eff is a Typelevel project. This means we embrace pure, typeful, functional programming, and provide a safe and friendly environment for teaching, learning, and contributing as described in the Scala Code of Conduct.
Feel free to open an issue if you notice a bug, have an idea for a feature, or have a question about the code. Pull requests are also gladly accepted.
- eff-zio eff extension for ZIO effects.