trait
Interpret extends AnyRef
Type Members
-
type
of[F[_], G[_]] = AnyRef { type l[A] = F[G[A]] }
Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
augment[R, T[_], O[_], A](eff: Eff[R, A])(w: Augment[T, O])(implicit memberT: MemberInOut[T, R], memberO: MemberIn[O, R]): Eff[R, A]
-
def
clone(): AnyRef
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
def
intercept[R, T[_], A, B](e: Eff[R, A])(interpreter: Interpreter[T, R, A, B])(implicit m: /=[T, R]): Eff[R, B]
-
def
interceptNat[R, T[_], A](effect: Eff[R, A])(nat: ~>[T, T])(implicit m: /=[T, R]): Eff[R, A]
-
def
interceptNatM[R, M[_], F[_], A](effect: Eff[R, A], nat: ~>[M, [A]M[F[A]]])(implicit m: MemberInOut[M, R], FT: Traverse[F], FM: Monad[F]): Eff[R, F[A]]
-
def
interpretUnsafe[R, U, T[_], A](effect: Eff[R, A])(sideEffect: SideEffect[T])(implicit m: Aux[T, R, U]): Eff[U, A]
-
final
def
isInstanceOf[T0]: Boolean
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
def
recurse[R, U, T[_], A, B](e: Eff[R, A])(recurser: Recurser[T, U, A, B])(implicit m: Aux[T, R, U]): Eff[U, B]
-
def
runInterpreter[R, U, T[_], A, B](e: Eff[R, A])(interpreter: Interpreter[T, U, A, B])(implicit m: Aux[T, R, U]): Eff[U, B]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
def
trace[R, T[_], A](eff: Eff[R, A])(implicit memberT: MemberInOut[T, R], memberW: MemberInOut[[β$4$]Writer[T[_], β$4$], R]): Eff[R, A]
-
def
transform[SR, BR, U, TS[_], TB[_], A](effect: Eff[SR, A], nat: ~>[TS, TB])(implicit sr: Aux[TS, SR, U], br: Aux[TB, BR, U]): Eff[BR, A]
-
def
translate[R, U, T[_], A](effect: Eff[R, A])(tr: Translate[T, U])(implicit m: Aux[T, R, U]): Eff[U, A]
-
def
translateInto[R, T[_], U, A](effect: Eff[R, A])(tr: Translate[T, U])(implicit t: /=[T, R], into: IntoPoly[R, U]): Eff[U, A]
-
def
translateNat[R, U, T[_], A](effects: Eff[R, A])(nat: ~>[T, [β$0$]Eff[U, β$0$]])(implicit m: Aux[T, R, U]): Eff[U, A]
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
-
def
write[R, T[_], O, A](eff: Eff[R, A])(w: Write[T, O])(implicit memberT: MemberInOut[T, R], memberW: MemberIn[[β$1$]Writer[O, β$1$], R]): Eff[R, A]
Inherited from AnyRef
Inherited from Any
The Interpret trait provides method to interpret (or "handle") effects.
An interpreter generally handles a given effect M and a value Eff[R, A] where M is a member of R.
The most general way of interpreting an effect is to implement the Interpreter trait for that effect and use the runInterpreter method. With the
Interpreter
trait you need to define:For each of those methods you get access to a continuation which you may or may not invoke to create the next effect in a sequence of effects. For example with the EitherEffect once you arrive on a Left value you don't trigger the continuation because there is no value to trigger it with.
There are also easier ways to define interpreters. The
recurse
method and theRecurser
trait define:Even simpler, the
Translate
trait does a translation from an effectM[X]
to other effects in the stack.There are also a few
intercept
methods to use an effect but still leave it in the stack