eff 4.0.0
New interpreters!
This version provides a generic interpreter "loop" to interpret Eff
values. You just need to provide an Interpreter
trait with appropriate definitions for:
- interpreting pure values
- interpreting an effect of type
M[X]
- interpreting a list of effects
T[M[X]]
(the "applicative" case) whereT
has aTraverse
instance - interpreting a "last" effect, in case of having side-effects to finalize resources (see
SafeEffect.thenFinally
)
This new org.atnos.eff.interpret.interpret
method is stack-safe provided that you never call continuations directly
but always with Eff.impure(x, continuation)
(see the various effects interpreters for examples).
There are also simpler traits like Recurser
or Translate
, please read the scaladoc for the Interpret trait.
Changes
There are only low-level API changes
-
many of the
Interpret
trait method have changed (interpret
,intercept
,...) or been removed. Please use
the gitter channel if you have any questions -
the "continuation" type inside an
Eff
value has been renamedContinuation
to help newcomers understand the library better
Improvements
Eff.tailRecM
is now stack-safe- the
catbird
andtwitter-util
dependencies have been updated (thanks to Chris Vale) EitherEffect.attemptEither
will attempt anEither
effect and returnE Either A
EitherEffect.runEitherCatchLeft
will run anEither
effect and handle the resultingE Either A
value in case of a
failure