Stateful

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

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.

trait Flow
trait Signature
class Object
trait Matchable
class Any
class Stateful[S, F]

Type members

Types

final override type Initial = S
final override type Result[+A] = F[A]
final override type ThisControl[U] = Apply[[M[_], X] =>> S => M[F[X]], U]
final override type Trans[M[_], X] = S => M[F[X]]

Inherited types

final override type !@![A, U] = ThisControl[U] => Any { def apply(kk: ThisControl[U]): Trans[LowerMonad, UpperFunctor[A]]; }
Inherited from:
Flow
final override type IntroEffect = Any
Inherited from:
Flow

Abstract type that must be used in definitions of effect's operations.

Abstract type that must be used in definitions of effect's operations.

From the perspective of effect's user, ThisEffect is just an alias of this.type. The final-override happens in Effect.

From the perspective of handler, ThisEffect definition is enriched in a way depending on the chosen Interpreter.

Inherited from:
Signature

Alias for Handler, specialized for this interperter.

Alias for Handler, specialized for this interperter.

Inherited from:
Interpreter

Value members

Concrete methods

final def toHandler(initial: S): ThisHandler

Creates a Handler from this interpreter.

Creates a Handler from this interpreter.

Inherited methods

def onFlatMap[A, B, M[_] : MonadZip](tma: M => A)(f: A => M => B): M => B
Inherited from:
Flow
def onPure[A](a: A): [X] =>> X => A
Inherited from:
Flow
def onZip[A, B, M[_] : MonadZip](tma: M => A, tmb: M => B): M => (A, B)
Inherited from:
Flow