Interpreter

turbolift.interpreter.Interpreter
See theInterpreter companion object
sealed trait Interpreter extends Signature

Super trait for any user-defined Interpreter.

  1. Interpreters are not meant to be created directly. Instead, one of abstract interpreters, provided by Effect, should be inherited:
  1. Interpreters are not meant to be used directly. Instead, a Handler should be created from the interpreter, by calling toHandler method on it.

Attributes

Companion
object
Graph
Supertypes
trait Signature
class Object
trait Matchable
class Any
Known subtypes
class Proxy[Fx]
class Proxy[Fx]
class Stateful[F, G, Fx]
class Stateful[F, G, Fx]
class Stateless[F, G, Fx]
class Stateless[F, G, Fx]
Show all

Members list

Type members

Types

type Ambient

Phantom type, representing universally quantified type of the corresponding handler.

Phantom type, representing universally quantified type of the corresponding handler.

A Handler acts as a higher-rank function of type:

[A, U] => (From[A] !! (Elim & U)) => To[A] !! (Intro & U)

The Ambient type of this interpreter corresponds to the U type parameter above. See also Unknown.

Attributes

type Elim

Set of effects eliminated from computation by this interpreter.

Set of effects eliminated from computation by this interpreter.

Attributes

type From[+A]

Input of this interpreter.

Input of this interpreter.

Attributes

type Intro

Set of effects introduced into computation by this interpreter (a.k.a. dependencies).

Set of effects introduced into computation by this interpreter (a.k.a. dependencies).

Attributes

type Local

Local state of this interpreter.

Local state of this interpreter.

Attributes

final type ThisEffect = Intro & Ambient

Self-reference to the effect being described by this Signature.

Self-reference to the effect being described by this Signature.

Becomes an alias of this.type, once the signature is inherited from Effect.

Attributes

type To[+A]

Output of this interpreter.

Output of this interpreter.

Attributes

type Unknown

Phantom type, representing universally quantified type of the corresponding handler.

Phantom type, representing universally quantified type of the corresponding handler.

A Handler acts as a higher-rank function of type:

[A, U] => (From[A] !! (Elim & U)) => To[A] !! (Intro & U)

The Unknown type of this interpreter corresponds to the A type parameter above. See also Ambient.

Attributes

Value members

Abstract methods

def onFork(s: Local): (Local, Local)
def onJoin(s1: Local, s2: Local): Local
def onUnknown(aa: To[Unknown]): Option[Unknown]
def onZip[A, B, C](aa: To[A], bb: To[B], k: (A, B) => C): To[C]

Concrete methods

def captureHint: Boolean

Microoptimization hint, stating intent to use continuations.

Microoptimization hint, stating intent to use continuations.

Many effect handlers never capture the continuation, and this is the default expectation.

The capture will work regardless of value of this hint. However, if not overriden to true, the first capture will be more costly.

Attributes

final inline def hasForkJoin: Boolean
final inline def hasRestart: Boolean
final inline def hasZip: Boolean
final inline def isIo: Boolean
final inline def isParallel: Boolean
final inline def isStateful: Boolean
final inline def isStateless: Boolean
final inline def localCount: Int
final inline def prompt: Prompt
final def toHandler: Handler[From, To, Elim, Intro]

Creates a Handler from this interpreter.

Creates a Handler from this interpreter.

Attributes

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any

Concrete fields

An instance of Control dedicated for this interpreter.

An instance of Control dedicated for this interpreter.

Attributes

An instance of Local dedicated for this interpreter.

An instance of Local dedicated for this interpreter.

Attributes