- StateT <S, M, A> (Func<S, K<M, (A Value, S State)>> runState)
- Pure (A value)
- Modify (Func<S, S> f)
- ModifyM (Func<S, K<M, S>> f)
- Put (S value)
- State (A value, S state)
- State ((A value, S state) ma)
- Get
- Gets (Func<S, A> f)
- GetsM (Func<S, K<M, A>> f)
- Lift (Pure<A> monad)
- Lift (K<M, A> monad)
- Lift (Func<A> f)
- LiftIO (IO<A> ma)
- MapT <M1, B> (Func<K<M, (A Value, S State)>, K<M1, (B Value, S State)>> f)
- MapM <B> (Func<K<M, A>, K<M, B>> f)
- Map <B> (Func<A, B> f)
- Select <B> (Func<A, B> f)
- Bind <B> (Func<A, K<StateT<S, M>, B>> f)
- Bind <B> (Func<A, StateT<S, M, B>> f)
- Bind <B> (Func<A, Gets<S, B>> f)
- Bind (Func<A, Put<S>> f)
- Bind (Func<A, Modify<S>> f)
- Bind <B> (Func<A, IO<B>> f)
- Bind <B> (Func<A, K<IO, B>> f)
- SelectMany <B, C> (Func<A, K<StateT<S, M>, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, StateT<S, M, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, K<M, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, Pure<B>> bind, Func<A, B, C> project)
- SelectMany <C> (Func<A, Put<S>> bind, Func<A, Unit, C> project)
- SelectMany <B, C> (Func<A, Gets<S, B>> bind, Func<A, B, C> project)
- SelectMany <C> (Func<A, Modify<S>> bind, Func<A, Unit, C> project)
- SelectMany <B, C> (Func<A, IO<B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, K<IO, B>> bind, Func<A, B, C> project)
- >> (StateT<S, M, A> lhs, StateT<S, M, A> rhs)
- >> (StateT<S, M, A> lhs, K<StateT<S, M>, A> rhs)
- >> (StateT<S, M, A> lhs, StateT<S, M, Unit> rhs)
- >> (StateT<S, M, A> lhs, K<StateT<S, M>, Unit> rhs)
- | (StateT<S, M, A> ma, K<StateT<S, M>, A> mb)
- | (K<StateT<S, M>, A> ma, StateT<S, M, A> mb)
- | (StateT<S, M, A> ma, Pure<A> mb)
- | (Pure<A> ma, StateT<S, M, A>mb)
- | (IO<A> ma, StateT<S, M, A> mb)
- | (StateT<S, M, A> ma, IO<A> mb)
- + (StateT<S, M, A> ma, K<StateT<S, M>, A> mb)
- + (K<StateT<S, M>, A> ma, StateT<S, M, A> mb)
- + (StateT<S, M, A> ma, Pure<A> mb)
- + (Pure<A> ma, StateT<S, M, A>mb)
- + (IO<A> ma, StateT<S, M, A> mb)
- + (StateT<S, M, A> ma, IO<A> mb)
- Run (S state)
- StateTExtensions
- As <S, M, A> (this K<StateT<S, M>, A> ma)
- Run <S, M, A> (this K<StateT<S, M>, A> ma, S state)
- Flatten <S, M, A> (this StateT<S, M, StateT<S, M, A>> mma)
- SelectMany <S, M, A, B, C> ( this K<M, A> ma, Func<A, K<StateT<S, M>, B>> bind, Func<A, B, C> project)
- SelectMany <S, M, A, B, C> ( this K<M, A> ma, Func<A, StateT<S, M, B>> bind, Func<A, B, C> project)
- StateTExtensions
- Map <S, M, A, B> (this Func<A, B> f, K<StateT<S, M>, A> ma)
- Map <S, M, A, B> (this Func<A, B> f, StateT<S, M, A> ma)
- Action <S, M, A, B> (this StateT<S, M, A> ma, K<StateT<S, M>, B> mb)
- Action <S, M, A, B> (this K<StateT<S, M>, A> ma, K<StateT<S, M>, B> mb)
- Apply <S, M, A, B> (this StateT<S, M, Func<A, B>> mf, K<StateT<S, M>, A> ma)
- Apply <S, M, A, B> (this K<StateT<S, M>, Func<A, B>> mf, K<StateT<S, M>, A> ma)
- StateT <S>
- StateT <S, M>
- StateT
- pure <S, M, A> (A value)
- lift <S, M, A> (K<M, A> ma)
- liftIO <S, M, A> (IO<A> effect)
- get <M, S> ()
- gets <M, S, A> (Func<S, A> f)
- getsM <M, S, A> (Func<S, K<M, A>> f)
- put <M, S> (S state)
- modify <M, S> (Func<S, S> f)
- modifyM <M, S> (Func<S, K<M, S>> f)
- StateT <S, M>
- Prelude
record StateT <S, M, A> (Func<S, K<M, (A Value, S State)>> runState) Source #
StateT
monad transformer, which adds a modifiable state to a given monad.
type | S | State type |
type | M | Given monad trait |
type | A | Bound value type |
param | runState | Transducer that represents the transformer operation |
method StateT<S, M, A> Pure (A value) Source #
Lift a pure value into the monad-transformer
param | value | Value to lift |
returns |
|
method StateT<S, M, Unit> Modify (Func<S, S> f) Source #
Extracts the state value, maps it, and then puts it back into the monadic state.
param | f | State mapping function |
returns |
|
method StateT<S, M, Unit> ModifyM (Func<S, K<M, S>> f) Source #
Extracts the state value, maps it, and then puts it back into the monadic state.
param | f | State mapping function |
returns |
|
method StateT<S, M, Unit> Put (S value) Source #
Writes the value into the monadic state
returns |
|
method StateT<S, M, A> State (A value, S state) Source #
Writes a value and state into the monad
returns |
|
method StateT<S, M, A> State ((A value, S state) ma) Source #
Writes a value and state into the monad
returns |
|
method StateT<S, M, A> Gets (Func<S, A> f) Source #
Extracts the state value and maps it to the bound value
param | f | State mapping function |
returns |
|
method StateT<S, M, A> GetsM (Func<S, K<M, A>> f) Source #
Extracts the state value and maps it to the bound value
param | f | State mapping function |
returns |
|
method StateT<S, M, A> Lift (Pure<A> monad) Source #
Lifts a given monad into the transformer
param | monad | Monad to lift |
returns |
|
method StateT<S, M, A> Lift (K<M, A> monad) Source #
Lifts a given monad into the transformer
param | monad | Monad to lift |
returns |
|
method StateT<S, M, A> Lift (Func<A> f) Source #
Lifts a function into the transformer
param | f | Function to lift |
returns |
|
method StateT<S, M, A> LiftIO (IO<A> ma) Source #
Lifts an IO monad into the monad
NOTE: If the IO monad isn't the innermost monad of the transformer stack then this will throw an exception.
param | ma | IO monad to lift |
returns |
|
method StateT<S, M1, B> MapT <M1, B> (Func<K<M, (A Value, S State)>, K<M1, (B Value, S State)>> f) Source #
Maps the given monad
type | M1 | Trait of the monad to map to |
param | f | Mapping function |
returns |
|
method StateT<S, M, B> MapM <B> (Func<K<M, A>, K<M, B>> f) Source #
Maps the given monad
param | f | Mapping function |
returns |
|
method StateT<S, M, B> Map <B> (Func<A, B> f) Source #
Maps the bound value
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method StateT<S, M, B> Select <B> (Func<A, B> f) Source #
Maps the bound value
type | B | Target bound value type |
param | f | Mapping transducer |
returns |
|
method StateT<S, M, B> Bind <B> (Func<A, K<StateT<S, M>, B>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method StateT<S, M, B> Bind <B> (Func<A, StateT<S, M, B>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method StateT<S, M, B> Bind <B> (Func<A, Gets<S, B>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method StateT<S, M, Unit> Bind (Func<A, Put<S>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method StateT<S, M, Unit> Bind (Func<A, Modify<S>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method StateT<S, M, B> Bind <B> (Func<A, IO<B>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method StateT<S, M, B> Bind <B> (Func<A, K<IO, B>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method StateT<S, M, C> SelectMany <B, C> (Func<A, K<StateT<S, M>, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method StateT<S, M, C> SelectMany <B, C> (Func<A, StateT<S, M, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method StateT<S, M, C> SelectMany <B, C> (Func<A, K<M, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method StateT<S, M, C> SelectMany <B, C> (Func<A, Pure<B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method StateT<S, M, C> SelectMany <C> (Func<A, Put<S>> bind, Func<A, Unit, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method StateT<S, M, C> SelectMany <B, C> (Func<A, Gets<S, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method StateT<S, M, C> SelectMany <C> (Func<A, Modify<S>> bind, Func<A, Unit, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method StateT<S, M, C> SelectMany <B, C> (Func<A, IO<B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method StateT<S, M, C> SelectMany <B, C> (Func<A, K<IO, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
operator >> (StateT<S, M, A> lhs, StateT<S, M, A> rhs) Source #
Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in C#.
param | lhs | First action to run |
param | rhs | Second action to run |
returns | Result of the second action |
operator >> (StateT<S, M, A> lhs, K<StateT<S, M>, A> rhs) Source #
Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in C#.
param | lhs | First action to run |
param | rhs | Second action to run |
returns | Result of the second action |
operator >> (StateT<S, M, A> lhs, StateT<S, M, Unit> rhs) Source #
Sequentially compose two actions. The second action is a unit returning action, so the result of the first action is propagated.
param | lhs | First action to run |
param | rhs | Second action to run |
returns | Result of the first action |
class StateTExtensions Source #
State monad extensions
method StateT<S, M, A> As <S, M, A> (this K<StateT<S, M>, A> ma) Source #
method K<M, (A Value, S State)> Run <S, M, A> (this K<StateT<S, M>, A> ma, S state) Source #
Run the state monad
param | state | Initial state |
returns | Bound monad |
method StateT<S, M, A> Flatten <S, M, A> (this StateT<S, M, StateT<S, M, A>> mma) Source #
Monadic join
method StateT<S, M, C> SelectMany <S, M, A, B, C> ( this K<M, A> ma, Func<A, K<StateT<S, M>, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method StateT<S, M, C> SelectMany <S, M, A, B, C> ( this K<M, A> ma, Func<A, StateT<S, M, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
class StateTExtensions Source #
method StateT<S, M, B> Map <S, M, A, B> (this Func<A, B> f, K<StateT<S, M>, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method StateT<S, M, B> Map <S, M, A, B> (this Func<A, B> f, StateT<S, M, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method StateT<S, M, B> Action <S, M, A, B> (this StateT<S, M, A> ma, K<StateT<S, M>, B> mb) Source #
Applicative action: runs the first applicative, ignores the result, and returns the second applicative
method StateT<S, M, B> Action <S, M, A, B> (this K<StateT<S, M>, A> ma, K<StateT<S, M>, B> mb) Source #
Applicative action: runs the first applicative, ignores the result, and returns the second applicative
method StateT<S, M, B> Apply <S, M, A, B> (this StateT<S, M, Func<A, B>> mf, K<StateT<S, M>, A> ma) Source #
Applicative functor apply operation
Unwraps the value within the ma
applicative-functor, passes it to the unwrapped function(s) within mf
, and
then takes the resulting value and wraps it back up into a new applicative-functor.
param | ma | Value(s) applicative functor |
param | mf | Mapping function(s) |
returns | Mapped applicative functor |
method StateT<S, M, B> Apply <S, M, A, B> (this K<StateT<S, M>, Func<A, B>> mf, K<StateT<S, M>, A> ma) Source #
Applicative functor apply operation
Unwraps the value within the ma
applicative-functor, passes it to the unwrapped function(s) within mf
, and
then takes the resulting value and wraps it back up into a new applicative-functor.
param | ma | Value(s) applicative functor |
param | mf | Mapping function(s) |
returns | Mapped applicative functor |
MonadStateT
trait implementation for StateT
type | S | State environment type |
type | M | Given monad trait |
method StateT<S, M, B> map <S, M, A, B> (Func<A, B> f, K<StateT<S, M>, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method StateT<S, M, B> action <S, M, A, B> (K<StateT<S, M>, A> ma, K<StateT<S, M>, B> mb) Source #
Applicative action: runs the first applicative, ignores the result, and returns the second applicative
method StateT<S, M, B> apply <S, M, A, B> (K<StateT<S, M>, Func<A, B>> mf, K<StateT<S, M>, A> ma) Source #
Applicative functor apply operation
Unwraps the value within the ma
applicative-functor, passes it to the unwrapped function(s) within mf
, and
then takes the resulting value and wraps it back up into a new applicative-functor.
param | ma | Value(s) applicative functor |
param | mf | Mapping function(s) |
returns | Mapped applicative functor |