ReactionADT

io.github.positionpal.reaction.ReactionADT.ReactionADT
opaque trait ReactionADT[E, S, R]

A data type used for representing a reaction to a given event

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait ComposableReaction[E, S, R]
trait OptionReaction[E, S, T]
trait FilterableReaction[E, S, R]

Members list

Type members

Types

opaque type Reaction[F[_]]

Represent the reaction that's triggered within a specific Context

Represent the reaction that's triggered within a specific Context

Type parameters

F

The effect to apply

Attributes

Represent the result of the reaction

Represent the result of the reaction

Attributes

Value members

Concrete methods

def on[F[_]](reaction: Context[E, S] => F[R]): Reaction[F]

Create a reaction on an given Context

Create a reaction on an given Context

Value parameters

reaction

The function representing the reaction.

Attributes

Returns

The Reaction object.

Extensions

Extensions

extension [F[_]](reaction: Reaction[F])(using evidence$1: Monad[F])
def apply: F[R]

Executes the Reaction producing a ReactionResult

Executes the Reaction producing a ReactionResult

Value parameters

context

The Context in which the Reaction should run

Attributes

Returns

a functional structure F in which the result is contained