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
Source:
Edomaton.scala
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)

Source:
Edomaton.scala
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

Source:
Edomaton.scala
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)

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

alias for map(_=> b)

alias for map(_=> b)

Source:
Edomaton.scala
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

Source:
Edomaton.scala
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

Source:
Edomaton.scala
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

Source:
Edomaton.scala
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

Source:
Edomaton.scala
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

Source:
Edomaton.scala
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.

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

maps output result

maps output result

Source:
Edomaton.scala
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

Source:
Edomaton.scala
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

Source:
Edomaton.scala
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

Source:
Edomaton.scala
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

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

Clears all notifications so far

Clears all notifications so far

Source:
Edomaton.scala
def transform[R2, E2, N2, B](f: Response[R, E, N, A] => Response[R2, E2, N2, B])(using Functor[F]): Edomaton[F, Env, R2, E2, N2, B]

transforms underlying response

transforms underlying response

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

Ignores output value

Ignores output value

Source:
Edomaton.scala

Inherited methods

Inherited from:
Product