dev.atedeg.mdm.utils.monads
Type members
Types
The same as an action with state but does not read an immutable state.
The same as an action with state but does not read an immutable state.
An action that can read an immutable state of type State
, emits one or more events of type Event
and
can either fail with an error of type Error
or produces a value of type Result
.
An action that can read an immutable state of type State
, emits one or more events of type Event
and
can either fail with an error of type Error
or produces a value of type Result
.
Signals that a method could emit elements of a given type which are accumulated in a list.
Signals that a method could emit elements of a given type which are accumulated in a list.
Signals that a method could fail with a given error type.
Signals that a method could fail with a given error type.
Signals that a method will always emit one or more elements of a given type which are accumulated in a list.
Signals that a method will always emit one or more elements of a given type which are accumulated in a list.
- Note:
this check is not imposed neither at compile-time nor at run-time. This is just used to better document the behaviour of methods but does not guarantee any invariant.
The same as a safe action but with two events.
The same as a safe action but with two events.
Value members
Concrete methods
Emits an element of type E
in a context M[_]
that accumulates emitted elements in a list.
Emits an element of type E
in a context M[_]
that accumulates emitted elements in a list.
Raises an error of type E
in a context M[_]
where the computation can be aborted.
Raises an error of type E
in a context M[_]
where the computation can be aborted.
Reads the current global state in a context M[_]
with a global state C
.
Reads the current global state in a context M[_]
with a global state C
.
Gets a view of the current state applying a function f
to it.
Gets a view of the current state applying a function f
to it.
unless(cond)(a)
performs the monadic action a
if the condition cond
is false.
unless(cond)(a)
performs the monadic action a
if the condition cond
is false.
Extensions
Extensions
ma.andThen(mb)
performs the monadic action ma
, ignores its return value
and then performs the monadic action mb
.
ma.andThen(mb)
performs the monadic action ma
, ignores its return value
and then performs the monadic action mb
.
ma.void
performs the monadic action ma
then discards its return value returning
Unit
in the context M[_]
.
ma.void
performs the monadic action ma
then discards its return value returning
Unit
in the context M[_]
.
sa.unsafeExecute(config)
runs the server action with a configuration.
sa.unsafeExecute(config)
runs the server action with a configuration.
- Note:
Don't use it in production!