- State <S, A>
- StateExtensions
- Flatten <Env, A> (this State<Env, State<Env, A>> ma)
- Run <S, A> (this State<S, A> self, S state)
- Sum <S> (this State<S, int> self)
- ToSeq <S, A> (this State<S, A> self)
- ToSeq <S, A> (this State<S, A> self, S state)
- AsEnumerable <S, A> (this State<S, A> self)
- AsEnumerable <S, A> (this State<S, A> self, S state)
- Count <S> (this State<S, int> self)
- ForAll <S, A> (this State<S, A> self, Func<A, bool> pred)
- Exists <S, A> (this State<S, A> self, Func<A, bool> pred)
- Fold <FState, S, A> (this State<S, A> self, FState initialState, Func<FState, A, FState> f)
- Fold <S, A> (this State<S, A> self, Func<S, A, S> f)
- Strict <S, A> (this State<S, A> ma)
- Do <S, A> (this State<S, A> ma, Action<A> f)
- Map <S, A, B> (this State<S, A> self, Func<A, B> f)
- Modify <S, A> (this State<S, A> self, Func<S, S> f)
- Bind <S, A, B> (this State<S, A> self, Func<A, State<S, B>> f)
- Select <S, A, B> (this State<S, A> self, Func<A, B> f)
- SelectMany <S, A, B, C> ( this State<S, A> self, Func<A, State<S, B>> bind, Func<A, B, C> project)
- Filter <S, A> (this State<S, A> self, Func<A, bool> pred)
- Where <S, A> (this State<S, A> self, Func<A, bool> pred)
- Iter <S, A> (this State<S, A> self, Action<A> action)
- Prelude
- flatten <Env, A> (State<Env, State<Env, A>> ma)
- State <S, A> (A value)
- State <S, A> (Func<S, (A, S)> f)
- get <S> ()
- get <A, B> (Lens<A, B> la)
- put <S> (S state)
- put <A, B> (Lens<A, B> la, B value)
- modify <S> (Func<S, S> f)
- modify <A, B> (Lens<A, B> la, Func<B, B> f)
- gets <S, A> (Func<S, A> f)
- choose <S, A> (params State<S, Option<A>>[] monads)
- trystate <S, A> (State<S, A> value)
- tryfun <S, A> (State<S, A> ma)
- StateResult
class StateExtensions Source #
Extension methods for State
method (TryOption<A> Value, S State) Run <S, A> (this State<S, A> self, S state) Source #
Runs the State monad and memoizes the result in a TryOption monad. Use Match, IfSucc, IfNone, etc to extract.
method State<S, Seq<A>> AsEnumerable <S, A> (this State<S, A> self) Source #
method Seq<A> AsEnumerable <S, A> (this State<S, A> self, S state) Source #
method State<S, FState> Fold <FState, S, A> (this State<S, A> self, FState initialState, Func<FState, A, FState> f) Source #
method State<S, A> Strict <S, A> (this State<S, A> ma) Source #
Force evaluation of the monad (once only)
method State<S, A> Do <S, A> (this State<S, A> ma, Action<A> f) Source #
Impure iteration of the bound value in the structure
returns | Returns the original unmodified structure |
method State<S, Unit> Modify <S, A> (this State<S, A> self, Func<S, S> f) Source #
Monadic state transformer. Maps an old state to a new state inside a state monad. The old state is thrown away.
method State<S, C> SelectMany <S, A, B, C> ( this State<S, A> self, Func<A, State<S, B>> bind, Func<A, B, C> project) Source #
method State<S, A> State <S, A> (A value) Source #
State monad constructor
type | S | State type |
type | A | Bound value type |
param | value | Value |
returns | State monad |
method State<S, A> State <S, A> (Func<S, (A, S)> f) Source #
State monad constructor
type | S | State type |
type | A | Bound value type |
param | value | Value |
returns | State monad |
method State<S, S> get <S> () Source #
Get the state from monad into its wrapped value
type | S | State type |
returns | State monad with state in the value |
method State<A, B> get <A, B> (Lens<A, B> la) Source #
Applies a lens in the 'get' direction within a state monad
method State<S, Unit> put <S> (S state) Source #
Set the state
type | S | State type |
returns | State monad with state set and with a Unit value |
method State<A, Unit> put <A, B> (Lens<A, B> la, B value) Source #
Applies a lens in the 'set' direction within a state monad
method State<S, Unit> modify <S> (Func<S, S> f) Source #
modify::MonadState s m => (s -> s) -> m()
Monadic state transformer.
Maps an old state to a new state inside a state monad.The old state is thrown away.
method State<A, Unit> modify <A, B> (Lens<A, B> la, Func<B, B> f) Source #
Update through a lens within a state monad
method State<S, A> gets <S, A> (Func<S, A> f) Source #
gets :: MonadState s m => (s -> a) -> m a
Gets specific component of the state, using a projection function supplied.