- RWS <MonoidW, R, W, S, A>
- RWSState <W, S>
- RWSResult <MonoidW, R, W, S, A>
- Bottom = new RWSResult<MonoidW, R, W, S, A>()
- Output
- State
- IsFaulted
- New (S state, A value)
- New (W output, S state, A value)
- New (S state, Error error)
- New (W output, S state, Error error)
- Match <B> (Func<A, B> Succ, Func<Error, B> Fail)
- Match (Action<A> Succ, Action<Error> Fail)
- IfFail (A value)
- IfFailThrow ()
- ToOption ()
- ToOptionUnsafe ()
- ToOptionAsync ()
- ToSeq ()
- ToList ()
- ToEither ()
- ToEither <L> (Func<Error, L> Left)
- ToEitherUnsafe ()
- ToEitherUnsafe <L> (Func<Error, L> Left)
- ToEitherAsync ()
- ToEitherAsync <L> (Func<Error, L> Left)
- ToTry ()
- ToTryAsync ()
- ToReader ()
- ToWriter ()
- ToState ()
- Equals (object obj)
- GetHashCode ()
- Equals (RWSResult<MonoidW, R, W, S, A> right)
- Equals (A right)
- == (RWSResult<MonoidW, R, W, S, A> left, A right)
- != (RWSResult<MonoidW, R, W, S, A> left, A right)
- == (RWSResult<MonoidW, R, W, S, A> left, RWSResult<MonoidW, R, W, S, A> right)
- != (RWSResult<MonoidW, R, W, S, A> left, RWSResult<MonoidW, R, W, S, A> right)
- Deconstruct (out A Value, out W Output, out S State, out Option<Error> Error)
- RWSExtensions
- Flatten <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, RWS<MonoidW, R, W, S, A>> ma)
- Run <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self, R env, S state)
- Sum <MonoidW, R, W, S> (this RWS<MonoidW, R, W, S, int> self)
- ToSeq <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self)
- AsEnumerable <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self)
- ToSeq <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self, R env, S state)
- AsEnumerable <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self, R env, S state)
- Count <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self)
- Exists <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self, Func<A, bool> pred)
- ForAll <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self, Func<A, bool> pred)
- Fold <MonoidW, R, W, S, A, B> (this RWS<MonoidW, R, W, S, A> self, B initialValue, Func<B, A, B> f)
- Fold <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self, Func<R, A, R> f)
- Strict <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> ma)
- Do <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> ma, Action<A> f)
- Modify <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, A> self, Func<S, S> f)
- Map <MonoidW, R, W, S, A, B> (this RWS<MonoidW, R, W, S, A> self, Func<A, B> project)
- Pass <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, (A, Func<W, W>)> self)
- Listen <MonoidW, R, W, S, A, B> (this RWS<MonoidW, R, W, S, A> ma, Func<W, B> f)
- Censor <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> ma, Func<W, W> f)
- Bind <MonoidW, R, W, S, A, B> (this RWS<MonoidW, R, W, S, A> ma, Func<A, RWS<MonoidW, R, W, S, B>> f)
- Select <MonoidW, R, W, S, A, B> (this RWS<MonoidW, R, W, S, A> ma, Func<A, B> f)
- SelectMany <MonoidW, R, W, S, A, B, C> ( this RWS<MonoidW, R, W, S, A> ma, Func<A, RWS<MonoidW, R, W, S, B>> bind, Func<A, B, C> project)
- Filter <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self, Func<A, bool> pred)
- Where <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self, Func<A, bool> pred)
- Iter <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self, Action<A> action)
- Prelude
- flatten <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, RWS<MonoidW, R, W, S, A>> ma)
- RWS <MonoidW, R, W, S, A> (A value)
- RWS <MonoidW, R, W, S, A> (S state, A value)
- RWS <MonoidW, R, W, S, A> (W output, S state, A value)
- RWS <MonoidW, R, W, S, A> (W output, A value)
- RWS <MonoidW, R, W, S, A> (Func<R, S, (A, W, S)> f)
- RWSFail <MonoidW, R, W, S, A> (Error error)
- RWSFail <MonoidW, R, W, S, A> (Exception exception)
- RWSFail <MonoidW, R, W, S, A> (string message, Exception exception)
- RWSFail <MonoidW, R, W, S, A> (string message)
- get <MonoidW, R, W, S, A> ()
- put <MonoidW, R, W, S, A> (S state)
- modify <MonoidW, R, W, S, A> (Func<S, S> f)
- gets <MonoidW, R, W, S, A> (Func<S, A> f)
- ask <MonoidW, R, W, S> ()
- asks <MonoidW, R, W, S, A> (Func<R, A> f)
- local <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, A> ma, Func<R, R> f)
- choose <MonoidW, R, W, S, A> (params RWS<MonoidW, R, W, S, Option<A>>[] monads)
- tryrws <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, A> m)
- tryfun <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, A> ma)
- sum <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, int> self)
- count <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, A> self)
- forall <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, A> self, Func<A, bool> pred)
- exists <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, A> self, Func<A, bool> pred)
- fold <MonoidW, R, W, S, A, FState> (RWS<MonoidW, R, W, S, A> self, FState initial, Func<FState, A, FState> f)
- fold <MonoidW, R, W, S, A, FState> (RWS<MonoidW, R, W, S, A> self, Func<R, A, R> f)
- pass <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, (A, Func<W, W>)> self)
- listen <MonoidW, R, W, S, A, B> (RWS<MonoidW, R, W, S, A> self, Func<W, B> f)
- censor <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, A> self, Func<W, W> f)
- tell <MonoidW, R, W, S, A> (W what)
- bind <MonoidW, R, W, S, A, B> (RWS<MonoidW, R, W, S, A> self, Func<A, RWS<MonoidW, R, W, S, B>> f)
- map <MonoidW, R, W, S, A, B> (RWS<MonoidW, R, W, S, A> self, Func<A, B> f)
- filter <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, A> self, Func<A, bool> pred)
- iter <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, A> self, Action<A> action)
struct RWSResult <MonoidW, R, W, S, A> Source #
field RWSResult<MonoidW, R, W, S, A> Bottom = new RWSResult<MonoidW, R, W, S, A>() Source #
method A IfFailThrow () Source #
method OptionUnsafe<A> ToOptionUnsafe () Source #
method OptionAsync<A> ToOptionAsync () Source #
method EitherUnsafe<Error, A> ToEitherUnsafe () Source #
method EitherUnsafe<L, A> ToEitherUnsafe <L> (Func<Error, L> Left) Source #
method EitherAsync<Error, A> ToEitherAsync () Source #
method EitherAsync<L, A> ToEitherAsync <L> (Func<Error, L> Left) Source #
method TryAsync<A> ToTryAsync () Source #
method int GetHashCode () Source #
method void Deconstruct (out A Value, out W Output, out S State, out Option<Error> Error) Source #
class RWSExtensions Source #
Extension methods for RWS
method RWS<MonoidW, R, W, S, A> Flatten <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, RWS<MonoidW, R, W, S, A>> ma) Source #
Monadic join
method RWSResult<MonoidW, R, W, S, A> Run <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self, R env, S state) Source #
Runs the RWS monad and memoizes the result in a TryOption monad. Use Match, IfSucc, IfNone, etc to extract.
method RWS<MonoidW, R, W, S, int> Sum <MonoidW, R, W, S> (this RWS<MonoidW, R, W, S, int> self) Source #
method RWS<MonoidW, R, W, S, Seq<A>> ToSeq <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self) Source #
method RWS<MonoidW, R, W, S, Seq<A>> AsEnumerable <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self) Source #
method Seq<A> ToSeq <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self, R env, S state) Source #
method Seq<A> AsEnumerable <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self, R env, S state) Source #
method RWS<MonoidW, R, W, S, int> Count <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self) Source #
method RWS<MonoidW, R, W, S, bool> Exists <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self, Func<A, bool> pred) Source #
method RWS<MonoidW, R, W, S, bool> ForAll <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self, Func<A, bool> pred) Source #
method RWS<MonoidW, R, W, S, B> Fold <MonoidW, R, W, S, A, B> (this RWS<MonoidW, R, W, S, A> self, B initialValue, Func<B, A, B> f) Source #
method RWS<MonoidW, R, W, S, R> Fold <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self, Func<R, A, R> f) Source #
method RWS<MonoidW, R, W, S, A> Strict <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> ma) Source #
Force evaluation of the monad (once only)
method RWS<MonoidW, R, W, S, A> Do <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> ma, Action<A> f) Source #
Impure iteration of the bound value in the structure
returns | Returns the original unmodified structure |
method RWS<MonoidW, R, W, S, Unit> Modify <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, A> self, Func<S, S> f) Source #
Monadic state transformer. Maps an old state to a new state inside a RWS monad. The old state is thrown away.
method RWS<MonoidW, R, W, S, B> Map <MonoidW, R, W, S, A, B> (this RWS<MonoidW, R, W, S, A> self, Func<A, B> project) Source #
method RWS<MonoidW, R, W, S, A> Pass <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, (A, Func<W, W>)> self) Source #
Pass is an action that executes the monad, which returns a value and a function, and returns the value, applying the function to the output.
method RWS<MonoidW, R, W, S, (A, B)> Listen <MonoidW, R, W, S, A, B> (this RWS<MonoidW, R, W, S, A> ma, Func<W, B> f) Source #
Listen is an action that executes the monad and adds its output to the value of the computation.
method RWS<MonoidW, R, W, S, A> Censor <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> ma, Func<W, W> f) Source #
Censor is an action that executes the monad and applies the function f to its output, leaving the return value unchanged.
method RWS<MonoidW, R, W, S, B> Bind <MonoidW, R, W, S, A, B> (this RWS<MonoidW, R, W, S, A> ma, Func<A, RWS<MonoidW, R, W, S, B>> f) Source #
method RWS<MonoidW, R, W, S, B> Select <MonoidW, R, W, S, A, B> (this RWS<MonoidW, R, W, S, A> ma, Func<A, B> f) Source #
method RWS<MonoidW, R, W, S, C> SelectMany <MonoidW, R, W, S, A, B, C> ( this RWS<MonoidW, R, W, S, A> ma, Func<A, RWS<MonoidW, R, W, S, B>> bind, Func<A, B, C> project) Source #
method RWS<MonoidW, R, W, S, A> Filter <MonoidW, R, W, S, A> (this RWS<MonoidW, R, W, S, A> self, Func<A, bool> pred) Source #
method RWS<MonoidW, R, W, S, A> flatten <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, RWS<MonoidW, R, W, S, A>> ma) Source #
Monadic join
method RWS<MonoidW, R, W, S, A> RWS <MonoidW, R, W, S, A> (A value) Source #
RWS monad constructor
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
param | value | Value |
returns | RWS monad |
method RWS<MonoidW, R, W, S, A> RWS <MonoidW, R, W, S, A> (S state, A value) Source #
RWS monad constructor
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
param | value | Value |
returns | RWS monad |
method RWS<MonoidW, R, W, S, A> RWS <MonoidW, R, W, S, A> (W output, S state, A value) Source #
RWS monad constructor
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
param | value | Value |
returns | RWS monad |
method RWS<MonoidW, R, W, S, A> RWS <MonoidW, R, W, S, A> (W output, A value) Source #
RWS monad constructor
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
param | value | Value |
returns | RWS monad |
method RWS<MonoidW, R, W, S, A> RWS <MonoidW, R, W, S, A> (Func<R, S, (A, W, S)> f) Source #
RWS monad constructor
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
param | value | Value |
returns | RWS monad |
method RWS<MonoidW, R, W, S, A> RWSFail <MonoidW, R, W, S, A> (Error error) Source #
RWS failure constructor
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
param | value | Value |
returns | RWS monad |
method RWS<MonoidW, R, W, S, A> RWSFail <MonoidW, R, W, S, A> (Exception exception) Source #
RWS failure constructor
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
param | value | Value |
returns | RWS monad |
method RWS<MonoidW, R, W, S, A> RWSFail <MonoidW, R, W, S, A> (string message, Exception exception) Source #
RWS failure constructor
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
param | value | Value |
returns | RWS monad |
method RWS<MonoidW, R, W, S, A> RWSFail <MonoidW, R, W, S, A> (string message) Source #
RWS failure constructor
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
param | value | Value |
returns | RWS monad |
method RWS<MonoidW, R, W, S, S> get <MonoidW, R, W, S, A> () Source #
Get the state from monad into its wrapped value
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
returns | RWS monad with state in the value |
method RWS<MonoidW, R, W, S, Unit> put <MonoidW, R, W, S, A> (S state) Source #
Set the state from monad into its wrapped value
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
returns | RWS monad with state set and with Unit value |
method RWS<MonoidW, R, W, S, Unit> modify <MonoidW, R, W, S, A> (Func<S, S> f) Source #
Monadic state transformer Maps an old state to a new state inside a RWS monad.The old state is thrown away.
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
returns | RWS monad with state set and with Unit value |
method RWS<MonoidW, R, W, S, A> gets <MonoidW, R, W, S, A> (Func<S, A> f) Source #
Gets a projection of the state
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
returns | RWS monad with projected value |
method RWS<MonoidW, R, W, S, R> ask <MonoidW, R, W, S> () Source #
Retrieves the reader monad environment.
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
returns | RWS monad with the environment in as the bound value |
method RWS<MonoidW, R, W, S, A> asks <MonoidW, R, W, S, A> (Func<R, A> f) Source #
Retrieves a function of the current environment.
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
returns | RWS monad with the mapped environment in as the bound value |
method RWS<MonoidW, R, W, S, A> local <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, A> ma, Func<R, R> f) Source #
Executes a computation in a modified environment
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
returns | RWS monad with the mapped environment in as the bound value |
method RWS<MonoidW, R, W, S, Option<A>> choose <MonoidW, R, W, S, A> (params RWS<MonoidW, R, W, S, Option<A>>[] monads) Source #
Chooses the first monad result that has a Some(x) for the value
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
returns | RWS monad with the mapped environment in as the bound value |
method RWS<MonoidW, R, W, S, A> tryrws <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, A> m) Source #
Run the RWS and catch exceptions
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
returns | RWS monad with the mapped environment in as the bound value |
method Try<RWS<MonoidW, R, W, S, A>> tryfun <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, A> ma) Source #
Run the RWS and catch exceptions
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
returns | RWS monad with the mapped environment in as the bound value |
method RWS<MonoidW, R, W, S, int> sum <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, int> self) Source #
method RWS<MonoidW, R, W, S, int> count <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, A> self) Source #
method RWS<MonoidW, R, W, S, bool> forall <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, A> self, Func<A, bool> pred) Source #
method RWS<MonoidW, R, W, S, bool> exists <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, A> self, Func<A, bool> pred) Source #
method RWS<MonoidW, R, W, S, FState> fold <MonoidW, R, W, S, A, FState> (RWS<MonoidW, R, W, S, A> self, FState initial, Func<FState, A, FState> f) Source #
method RWS<MonoidW, R, W, S, R> fold <MonoidW, R, W, S, A, FState> (RWS<MonoidW, R, W, S, A> self, Func<R, A, R> f) Source #
method RWS<MonoidW, R, W, S, A> pass <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, (A, Func<W, W>)> self) Source #
Pass is an action that executes the monad, which returns a value and a function, and returns the value, applying the function to the output.
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
method RWS<MonoidW, R, W, S, (A, B)> listen <MonoidW, R, W, S, A, B> (RWS<MonoidW, R, W, S, A> self, Func<W, B> f) Source #
Listen is an action that executes the monad and adds its output to the value of the computation.
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
method RWS<MonoidW, R, W, S, A> censor <MonoidW, R, W, S, A> (RWS<MonoidW, R, W, S, A> self, Func<W, W> f) Source #
Censor is an action that executes the writer monad and applies the function f to its output, leaving the return value unchanged.
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
method RWS<MonoidW, R, W, S, Unit> tell <MonoidW, R, W, S, A> (W what) Source #
Censor is an action that executes the writer monad and applies the function f to its output, leaving the return value unchanged.
type | R | Environment type |
type | W | Writer type |
type | S | State type |
type | A | Bound value type |
method RWS<MonoidW, R, W, S, B> bind <MonoidW, R, W, S, A, B> (RWS<MonoidW, R, W, S, A> self, Func<A, RWS<MonoidW, R, W, S, B>> f) Source #
method RWS<MonoidW, R, W, S, B> map <MonoidW, R, W, S, A, B> (RWS<MonoidW, R, W, S, A> self, Func<A, B> f) Source #