ModelTC

edomata.core.ModelTC
sealed trait ModelTC[State, Event, Rejection]

A type class that captures domain model

note that due to uniqueness requirements for this typeclass, it is sealed and the only way to create an instance is through implementing DomainModel.

so don't create several instances as it is a bad idea and may change your domain model behavior in different contexts!

Attributes

Source
Model.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def initial: State

Attributes

Source
Model.scala
def transition: Event => State => ValidatedNec[Rejection, State]

Attributes

Source
Model.scala

Concrete methods

final def handle[T](self: State, dec: Decision[Rejection, Event, T]): Decision[Rejection, Event, (State, T)]

like perform, but also returns initial output

like perform, but also returns initial output

Attributes

Source
Model.scala
final def perform(self: State, dec: Decision[Rejection, Event, Unit]): Decision[Rejection, Event, State]

Returns a decision that has applied this decision and folded state, so the output is new state

Returns a decision that has applied this decision and folded state, so the output is new state

Attributes

Source
Model.scala