state library

Classes

State<S, A>

Functions

evaluate<S>(S s) → A Function<A>(State<S, A> s)
Run a computation in the State monad, discarding the final state
execute<S>(S s) → S Function<A>(State<S, A> s)
Run a computation in the State monad, discarding the result
flatMap<S, A, B>(State<S, B> f(A a)) State<S, B> Function(State<S, A> fa)
Compose computations in sequence
flatMapFirst<S, A>(State<S, dynamic> f(A a)) State<S, A> Function(State<S, A> fa)
Compose computations in sequence, discarding the result
flatten<S, A>(State<S, State<S, A>> fa) State<S, A>
get<S>() State<S, S>
Get the current state
gets<S, A>(A f(S s)) State<S, A>
Get a value that depends on the state
map<S, A, B>(B f(A a)) State<S, B> Function(State<S, A>)
Transform the value of the State (the A type)
modify<S>(S f(S s)) State<S, Unit>
Modify the state with the given transformer function
of<S, A>(A a) State<S, A>
put<S>(S s) State<S, Unit>
Set the state
sequence<S, A>(Iterable<State<S, A>> states) State<S, IList<A>>