Decision

sealed trait Decision[+R, +E, +A] extends Product with 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

Companion:
object
Source:
Decision.scala
trait Product
trait Equals
class Object
trait Matchable
class Any
class Accepted[E, T]
class InDecisive[T]
class Rejected[R]
Decision[R, E, A]

Value members

Concrete methods

inline def >>[R2 >: R, E2 >: E, B](f: => Decision[R2, E2, B]): Decision[R2, E2, B]
inline def >>=[R2 >: R, E2 >: E, B](f: A => Decision[R2, E2, B]): Decision[R2, E2, B]
def as[B](b: B): Decision[R, E, B]
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

Source:
Decision.scala
@targetName("assertEitherNec")
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

Source:
Decision.scala
@targetName("assertEither")
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

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

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

whether is accepted or not

whether is accepted or not

Source:
Decision.scala

whether is rejected or not

whether is rejected or not

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

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

Ignores events and creates an Either

Ignores events and creates an Either

Source:
Decision.scala

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

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

Source:
Decision.scala

Ignores events and creates a ValidatedNec

Ignores events and creates a ValidatedNec

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

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

Validates output using an EitherNec

Validates output using an EitherNec

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

Validates output using an Either

Validates output using an Either

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

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

Ignores output value

Ignores output value

Source:
Decision.scala

Inherited methods

def canEqual(that: Any): Boolean
Inherited from:
Equals
Inherited from:
Product
def productElement(n: Int): Any
Inherited from:
Product
Inherited from:
Product
Inherited from:
Product
Inherited from:
Product