Edomaton

final case class Edomaton[F[_], -Env, R, E, N, A](run: Env => F[Response[R, E, N, A]]) extends AnyVal

Represents programs that are event driven state machines (a Mealy machine)

these programs can use input to decide on a state transition, and optionally emit a sequence of notifications for communication.

Type parameters:
A

output type

E

internal event type

Env

input type

F

effect type

N

notification type, a.k.a external event, integration event

R

rejection type

Companion:
object
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any

Value members

Concrete methods

inline def >>[Env2 <: Env, B](f: => Edomaton[F, Env2, R, E, N, B])(using Monad[F]): Edomaton[F, Env2, R, E, N, B]

alias for andThen, flatMap(_ => f)

alias for andThen, flatMap(_ => f)

inline def >>=[Env2 <: Env, B](f: A => Edomaton[F, Env2, R, E, N, B])(using Monad[F]): Edomaton[F, Env2, R, E, N, B]

alias for flatMap

alias for flatMap

inline def andThen[Env2 <: Env, B](f: => Edomaton[F, Env2, R, E, N, B])(using Monad[F]): Edomaton[F, Env2, R, E, N, B]

sequences another edomaton without considering output for this one

sequences another edomaton without considering output for this one

alias for flatMap(_ => f)

inline def as[B](b: B)(using Functor[F]): Edomaton[F, Env, R, E, N, B]

alias for map(_=> b)

alias for map(_=> b)

def contramap[Env2](f: Env2 => Env): Edomaton[F, Env2, R, E, N, A]

creates a new edomaton that translates some input to what this edomaton can understand

creates a new edomaton that translates some input to what this edomaton can understand

def decide[B](f: A => Decision[R, E, B])(using Monad[F]): Edomaton[F, Env, R, E, N, B]

Decides based on output

Decides based on output

def eval[B](f: => F[B])(using Monad[F]): Edomaton[F, Env, R, E, N, A]

evaluates an effect and uses its result as new output

evaluates an effect and uses its result as new output

def evalMap[B](f: A => F[B])(using Monad[F]): Edomaton[F, Env, R, E, N, B]

evaluates an effect using output of this edomaton and uses result of evaluation as new output

evaluates an effect using output of this edomaton and uses result of evaluation as new output

def evalTap[B](f: A => F[B])(using Monad[F]): Edomaton[F, Env, R, E, N, A]

like evalMap but ignores evaluation result

like evalMap but ignores evaluation result

def flatMap[Env2 <: Env, B](f: A => Edomaton[F, Env2, R, E, N, B])(using Monad[F]): Edomaton[F, Env2, R, E, N, B]

binds another edomaton to this one.

binds another edomaton to this one.

def map[B](f: A => B)(using Functor[F]): Edomaton[F, Env, R, E, N, B]

maps output result

maps output result

def mapK[G[_]](fk: FunctionK[F, G]): Edomaton[G, Env, R, E, N, A]

translates this program in another language mapped by a natural transformation

translates this program in another language mapped by a natural transformation

def publish(ns: N*)(using Functor[F]): Edomaton[F, Env, R, E, N, A]

Adds notification without considering decision state

Adds notification without considering decision state

def publishOnRejection(ns: N*)(using Functor[F]): Edomaton[F, Env, R, E, N, A]

publishes these notifications if this edomaton is rejected

publishes these notifications if this edomaton is rejected

def publishOnRejectionWith(f: Type[R] => Seq[N])(using Functor[F]): Edomaton[F, Env, R, E, N, A]

If this edomaton is rejected, uses given function to decide what to publish

If this edomaton is rejected, uses given function to decide what to publish

def reset(using Functor[F]): Edomaton[F, Env, R, E, N, A]

Clears all notifications so far

Clears all notifications so far

def transform[B](f: Response[R, E, N, A] => Response[R, E, N, B])(using Functor[F]): Edomaton[F, Env, R, E, N, B]

transforms underlying response

transforms underlying response

def void(using Functor[F]): Edomaton[F, Env, R, E, N, Unit]

Ignores output value

Ignores output value

Inherited methods

Inherited from:
Product