Decision

edomata.core.Decision
See theDecision companion object
sealed trait Decision[+R, +E, +A] extends Product, Serializable

Represents programs that decide in an event driven context

This is basically a simple state machine like the following:

[*] -> InDecisive
InDecisive -- event --> Accepted
InDecisive -- join --> InDecisive
InDecisive -- rejection --> Rejected (resets and terminates)
Accepted -- event --> Accepted (accumulates)
Accepted -- rejection --> Rejected (resets and terminates)

It forms a monad error and also is traversable.

Type parameters

A

program output type

E

event type

R

rejection type

Attributes

Companion
object
Source
Decision.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
class Accepted[E, T]
class InDecisive[T]
class Rejected[R]
Self type
Decision[R, E, A]

Members list

Value members

Concrete methods

inline def >>[R2 >: R, E2 >: E, B](f: => Decision[R2, E2, B]): Decision[R2, E2, B]

Attributes

Source
Decision.scala
inline def >>=[R2 >: R, E2 >: E, B](f: A => Decision[R2, E2, B]): Decision[R2, E2, B]

Attributes

Source
Decision.scala
def as[B](b: B): Decision[R, E, B]

Attributes

Source
Decision.scala
def assert[R2 >: R, B](f: A => ValidatedNec[R2, B]): Decision[R2, E, A]

Asserts output using a ValidatedNec without changing it

Asserts output using a ValidatedNec without changing it

Attributes

Source
Decision.scala
def assert[R2 >: R, B](f: A => EitherNec[R2, B]): Decision[R2, E, A]

Asserts output using an EitherNec without changing it

Asserts output using an EitherNec without changing it

Attributes

Source
Decision.scala
def assert[R2 >: R, B](f: A => Either[R2, B]): Decision[R2, E, A]

Asserts output using an Either without changing it

Asserts output using an Either without changing it

Attributes

Source
Decision.scala
def flatMap[R2 >: R, E2 >: E, B](f: A => Decision[R2, E2, B]): Decision[R2, E2, B]

binds another decision to this one, creates a new decision

binds another decision to this one, creates a new decision

Attributes

Source
Decision.scala
def flatTap[R2 >: R, E2 >: E, B](f: A => Decision[R2, E2, B]): Decision[R2, E2, A]

Attributes

Source
Decision.scala

whether is accepted or not

whether is accepted or not

Attributes

Source
Decision.scala

whether is rejected or not

whether is rejected or not

Attributes

Source
Decision.scala
def map[B](f: A => B): Decision[R, E, B]

creates a new decision that changes the output value of this one

creates a new decision that changes the output value of this one

Attributes

Source
Decision.scala
def toEither: EitherNec[R, A]

Ignores events and creates an Either

Ignores events and creates an Either

Attributes

Source
Decision.scala
def toOption: Option[A]

Ignores events and errors and creates an Option that contains program output

Ignores events and errors and creates an Option that contains program output

Attributes

Source
Decision.scala

Ignores events and creates a ValidatedNec

Ignores events and creates a ValidatedNec

Attributes

Source
Decision.scala
def validate[R2 >: R, B](f: A => ValidatedNec[R2, B]): Decision[R2, E, B]

Validates output using a ValidatedNec

Validates output using a ValidatedNec

Attributes

Source
Decision.scala
def validate[R2 >: R, B](f: A => EitherNec[R2, B]): Decision[R2, E, B]

Validates output using an EitherNec

Validates output using an EitherNec

Attributes

Source
Decision.scala
def validate[R2 >: R, B](f: A => Either[R2, B]): Decision[R2, E, B]

Validates output using an Either

Validates output using an Either

Attributes

Source
Decision.scala
def visit[B](fr: Type[R] => B, fa: A => B): B

traverses this decision, run fr if there are errors and runs fa if there is some output

traverses this decision, run fr if there are errors and runs fa if there is some output

Attributes

Source
Decision.scala
def void: Decision[R, E, Unit]

Ignores output value

Ignores output value

Attributes

Source
Decision.scala

Inherited methods

def canEqual(that: Any): Boolean

Attributes

Inherited from:
Equals

Attributes

Inherited from:
Product
def productElement(n: Int): Any

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product