Interpreter

Companion:
class
class Object
trait Matchable
class Any

Type members

Classlikes

sealed trait Flow extends Interpreter

Super trait for Stateless and Stateful interpreters.

Super trait for Stateless and Stateful interpreters.

trait Proxy[Fx] extends Interpreter

Super trait for any user-defined proxy Interpreter.

Super trait for any user-defined proxy Interpreter.

Proxy translates operations of this effect, into operations of some other effects (dependencies). This is also known as "reinterpretation" in some effect systems.

Unlike Flow interpreters, Proxy interpreters have their Result type fixed to identity.

Type parameters:
Fx

Type-level set of effects, expressed as an intersection type, specifying dependencies of this proxy interpreter.

abstract class Stateful[S, F[_]] extends Flow

Super class for any user-defined stateful Interpreter.

Super class for any user-defined stateful Interpreter.

Works by translating operations of this effect, into a monad, defined by transformer: T[M, A] = S => M[F[A]].

Implementation must provide:

  • Definitions for pure, flatMap and zip for the transformed monad, given MonadZip instance for the inner monad.
  • Functor instance for F[_]
Type parameters:
F

Part of this interpreter's monad transformer.

S

Part of this interpreter's monad transformer.

abstract class Stateless[F[_]] extends Flow

Super class for any user-defined stateless Interpreter.

Super class for any user-defined stateless Interpreter.

Works by translating operations of this effect, into a monad, defined by transformer: T[M, A] = M[F[A]].

Implementation must provide:

  • Definitions for pure, flatMap and zip for the transformed monad, given MonadZip instance for the inner monad.
  • Functor instance for F[_]
Type parameters:
F

Part of this interpreter's monad transformer.