You add eff as an sbt dependency:
libraryDependencies += "org.atnos" %% "eff" % "8.0.0"
// to write types like Reader[String, *]
// for Scala 3.3.x
scalacOptions += "-Ykind-projector"
// for latest Scala 3
scalacOptions += "-Xkind-projector"This table lists the other available eff modules:
| Name | Functionality | 
|---|---|
| eff-scalaz | if you want to use Scalaz as a library for
functional programming. This gives you a ScalazMonadinstance forEffand a Scalaz’s\/effect | 
| eff-monix | to use Monix’s Taskeffect | 
| eff-cats-effect | to use cats’s IOeffect | 
| eff-doobie | to use Doobie’s ConnectionIOeffect | 
The main eff types: Eff,
Member, Fx are accessible in the
org.atnos.eff package:
import org.atnos.eff._Many other effects are also available Out of the box.
The functions used to create effects are grouped under different
objects named after the effect type. For example if you want to create
the Eval effect you need to import:
import org.atnos.eff.eval._You can also import most of the effects at once with:
import org.atnos.eff.all._The only effects not included in the previous import are:
the Error effect. This effect requires a type
parameter representing the “failure” type and must be provided by the
user of the library
the Future effect. This effect shares some
operations like runAsync with other “async” effects like
monix’s TaskEffect and the import could clash with
import org.atnos.eff.addon.monix.task._
Interpreting effects usually requires some syntax to “run” a given
effect. For example to “run” the Option effect you will
import:
// to create the effect
import org.atnos.eff.option._
// to access the runOption method
import org.atnos.eff.syntax.option._
fromOption(Option(1)).runOptionYou can also access all the syntax imports at once with:
import org.atnos.eff.syntax.all.givenIntellij error highlighting doesn’t support implicit-directed type inference yet, check https://youtrack.jetbrains.com/issue/SCL-11140 or https://youtrack.jetbrains.com/issue/SCL-10753 for progress.
If you use Scalaz as your functional programming library you might need additional imports in order to use some creation methods specific to Scalaz. For example:
import org.atnos.eff.addon.scalaz.either._
fromDisjunction(\/-(1))There is also an all object importing all those methods
at once:
import org.atnos.eff.addon.scalaz.all._
fromDisjunction(\/-(1))And you can already guess, there are some syntax imports following the same pattern:
import org.atnos.eff.addon.scalaz.either._
import org.atnos.eff.addon.scalaz.syntax.either._
fromDisjunction(\/-(1)).runDisjunction