Interpreter

trait Interpreter[M[_], R, A, B]

Interpret eff values

For stack-safety reasons, the continuation must never be called with a value directly, but always with Eff.impure:

Eff.impure(a, continuation)

  • Note it is the responsibility of the implementation to call continuation.onNone if the continuation is not used to create the return value.
Companion
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def onApplicativeEffect[X, T[_] : Traverse](xs: T[M[X]], continuation: Continuation[R, T[X], B]): Eff[R, B]

Interpret a list of effects of type M

Interpret a list of effects of type M

if the value X can be extracted call the continuation to get the next Eff[R, B] value otherwise provide a Eff[R, B] value

def onEffect[X](x: M[X], continuation: Continuation[R, X, B]): Eff[R, B]

Interpret an effect of type M

Interpret an effect of type M

if the value X can be extracted call the continuation to get the next Eff[R, B] value otherwise provide a Eff[R, B] value

def onLastEffect[X](x: M[X], continuation: Continuation[R, X, Unit]): Eff[R, Unit]

Interpret a side-effect of type M

Interpret a side-effect of type M

if the value X can be extracted call the continuation to get the next Eff[R, B] value otherwise provide a Eff[R, B] value

def onPure(a: A): Eff[R, B]

Interpret a pure value

Interpret a pure value