- WriterT <W, M, A> (Func<W, K<M, (A Value, W Output)>> runWriter)
- Pure (A value)
- Write ((A Value, W Output) result)
- Write (A value, W output)
- Listen
- Listens <B> (Func<W, B> f)
- Censor (Func<W, W> 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, W Output)>, K<M1, (B Value, W Output)>> 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<WriterT<W, M>, B>> f)
- Bind <B> (Func<A, WriterT<W, M, B>> f)
- Bind <B> (Func<A, Tell<W>> f)
- Bind <B> (Func<A, IO<B>> f)
- SelectMany <B, C> (Func<A, K<WriterT<W, M>, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, WriterT<W, 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, Tell<W>> bind, Func<A, Unit, C> project)
- SelectMany <B, C> (Func<A, IO<B>> bind, Func<A, B, C> project)
- >> (WriterT<W, M, A> lhs, WriterT<W, M, A> rhs)
- >> (WriterT<W, M, A> lhs, K<WriterT<W, M>, A> rhs)
- >> (WriterT<W, M, A> lhs, WriterT<W, M, Unit> rhs)
- >> (WriterT<W, M, A> lhs, K<WriterT<W, M>, Unit> rhs)
- | (K<WriterT<W, M>, A> ma, WriterT<W, M, A> mb)
- | (WriterT<W, M, A> ma, K<WriterT<W, M>, A> mb)
- | (WriterT<W, M, A> ma, Pure<A> mb)
- | (Pure<A> ma, WriterT<W, M, A>mb)
- | (IO<A> ma, WriterT<W, M, A> mb)
- | (WriterT<W, M, A> ma, IO<A> mb)
- + (K<WriterT<W, M>, A> ma, WriterT<W, M, A> mb)
- + (WriterT<W, M, A> ma, K<WriterT<W, M>, A> mb)
- + (WriterT<W, M, A> ma, Pure<A> mb)
- + (Pure<A> ma, WriterT<W, M, A>mb)
- + (IO<A> ma, WriterT<W, M, A> mb)
- + (WriterT<W, M, A> ma, IO<A> mb)
- Run ()
- WriterTExtensions
- As <W, M, A> (this K<WriterT<W, M>, A> ma)
- Run <W, M, A> (this K<WriterT<W, M>, A> ma)
- Run <W, M, A> (this K<WriterT<W, M>, A> ma, W initial)
- Flatten <W, M, A> (this WriterT<W, M, WriterT<W, M, A>> mma)
- SelectMany <W, M, A, B, C> ( this K<M, A> ma, Func<A, K<WriterT<W, M>, B>> bind, Func<A, B, C> project)
- SelectMany <W, M, A, B, C> ( this K<M, A> ma, Func<A, WriterT<W, M, B>> bind, Func<A, B, C> project)
- WriterTExtensions
- Map <W, M, A, B> (this Func<A, B> f, K<WriterT<W, M>, A> ma)
- Map <W, M, A, B> (this Func<A, B> f, WriterT<W, M, A> ma)
- Action <W, M, A, B> (this WriterT<W, M, A> ma, K<WriterT<W, M>, B> mb)
- Action <W, M, A, B> (this K<WriterT<W, M>, A> ma, K<WriterT<W, M>, B> mb)
- Apply <W, M, A, B> (this WriterT<W, M, Func<A, B>> mf, K<WriterT<W, M>, A> ma)
- Apply <W, M, A, B> (this K<WriterT<W, M>, Func<A, B>> mf, K<WriterT<W, M>, A> ma)
- WriterT <W>
- WriterT <W, M>
- WriterT
- pure <W, M, A> (A value)
- lift <W, M, A> (K<M, A> ma)
- liftIO <W, M, A> (IO<A> effect)
- tell <W, M> (W item)
- write <W, M, A> ((A, W) item)
- write <W, M, A> (A value, W item)
- pass <W, M, A> (WriterT<W, M, (A Value, Func<W, W> Function)> action)
- listen <W, M, A> (WriterT<W, M, A> ma)
- listens <W, M, A, B> (Func<W, B> f, WriterT<W, M, A> ma)
- censor <W, M, A> (Func<W, W> f, WriterT<W, M, A> ma)
- WriterT <W, M>
- Prelude
record WriterT <W, M, A> (Func<W, K<M, (A Value, W Output)>> runWriter) Source #
WriterT
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 WriterT<W, M, A> Pure (A value) Source #
Lift a pure value into the monad-transformer
param | value | Value to lift |
returns |
|
method WriterT<W, M, A> Write ((A Value, W Output) result) Source #
Construct a writer computation from a (result, output) pair.
The inverse of Run()
param | result | Result / Output pair |
method WriterT<W, M, A> Write (A value, W output) Source #
Construct a writer computation from a (result, output) pair.
The inverse of Run()
param | result | Result / Output pair |
method WriterT<W, M, (A Value, B Output)> Listens <B> (Func<W, B> f) Source #
Listens
executes the action and adds the result of applying f
to the
output to the value of the computation.
method WriterT<W, M, A> Censor (Func<W, W> f) Source #
Censor
executes the action and applies the function f
to its output,
leaving the return value unchanged.
method WriterT<W, M, A> Lift (Pure<A> monad) Source #
Lifts a given monad into the transformer
param | monad | Monad to lift |
returns |
|
method WriterT<W, M, A> Lift (K<M, A> monad) Source #
Lifts a given monad into the transformer
param | monad | Monad to lift |
returns |
|
method WriterT<W, M, A> Lift (Func<A> f) Source #
Lifts a function into the transformer
param | f | Function to lift |
returns |
|
method WriterT<W, M, A> LiftIO (IO<A> ma) Source #
Lifts a 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 WriterT<W, M1, B> MapT <M1, B> (Func<K<M, (A Value, W Output)>, K<M1, (B Value, W Output)>> f) Source #
Maps the given monad
type | M1 | Trait of the monad to map to |
param | f | Mapping function |
returns |
|
method WriterT<W, M, B> MapM <B> (Func<K<M, A>, K<M, B>> f) Source #
Maps the given monad
param | f | Mapping function |
returns |
|
method WriterT<W, 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 WriterT<W, 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 WriterT<W, M, B> Bind <B> (Func<A, K<WriterT<W, M>, B>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method WriterT<W, M, B> Bind <B> (Func<A, WriterT<W, M, B>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method WriterT<W, M, Unit> Bind <B> (Func<A, Tell<W>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method WriterT<W, 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 WriterT<W, M, C> SelectMany <B, C> (Func<A, K<WriterT<W, 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 WriterT<W, M, C> SelectMany <B, C> (Func<A, WriterT<W, 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 WriterT<W, 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 WriterT<W, 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 WriterT<W, M, C> SelectMany <C> (Func<A, Tell<W>> 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 WriterT<W, 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 |
|
operator >> (WriterT<W, M, A> lhs, WriterT<W, 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 >> (WriterT<W, M, A> lhs, K<WriterT<W, 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 >> (WriterT<W, M, A> lhs, WriterT<W, 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 WriterTExtensions Source #
method WriterT<W, M, A> As <W, M, A> (this K<WriterT<W, M>, A> ma) Source #
method K<M, (A Value, W Output)> Run <W, M, A> (this K<WriterT<W, M>, A> ma) Source #
Run the writer
returns | Bound monad |
method K<M, (A Value, W Output)> Run <W, M, A> (this K<WriterT<W, M>, A> ma, W initial) Source #
Run the writer
returns | Bound monad |
method WriterT<W, M, A> Flatten <W, M, A> (this WriterT<W, M, WriterT<W, M, A>> mma) Source #
Monadic join
method WriterT<W, M, C> SelectMany <W, M, A, B, C> ( this K<M, A> ma, Func<A, K<WriterT<W, 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 WriterT<W, M, C> SelectMany <W, M, A, B, C> ( this K<M, A> ma, Func<A, WriterT<W, 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 WriterTExtensions Source #
method WriterT<W, M, B> Map <W, M, A, B> (this Func<A, B> f, K<WriterT<W, 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 WriterT<W, M, B> Map <W, M, A, B> (this Func<A, B> f, WriterT<W, 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 WriterT<W, M, B> Action <W, M, A, B> (this WriterT<W, M, A> ma, K<WriterT<W, M>, B> mb) Source #
Applicative action: runs the first applicative, ignores the result, and returns the second applicative
method WriterT<W, M, B> Action <W, M, A, B> (this K<WriterT<W, M>, A> ma, K<WriterT<W, M>, B> mb) Source #
Applicative action: runs the first applicative, ignores the result, and returns the second applicative
method WriterT<W, M, B> Apply <W, M, A, B> (this WriterT<W, M, Func<A, B>> mf, K<WriterT<W, 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 WriterT<W, M, B> Apply <W, M, A, B> (this K<WriterT<W, M>, Func<A, B>> mf, K<WriterT<W, 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 |
MonadWriterT
trait implementation for WriterT
type | S | State environment type |
type | M | Given monad trait |
MonadWriterT
trait implementation for WriterT
type | S | State environment type |
type | M | Given monad trait |
MonadWriterT
trait implementation for WriterT
type | S | State environment type |
type | M | Given monad trait |
method WriterT<W, M, A> pure <W, M, A> (A value) Source #
method WriterT<W, M, A> lift <W, M, A> (K<M, A> ma) Source #
method WriterT<W, M, A> liftIO <W, M, A> (IO<A> effect) Source #
Lifts a given monad into the transformer
param | effect | Monad to lift |
returns |
|
method WriterT<W, M, Unit> tell <W, M> (W item) Source #
Tell is an action that produces the writer output
type | W | Writer type |
param | item | Item to tell |
returns | Structure with the told item |
method WriterT<W, M, A> write <W, M, A> ((A, W) item) Source #
Writes an item and returns a value at the same time
method WriterT<W, M, A> write <W, M, A> (A value, W item) Source #
Writes an item and returns a value at the same time
method WriterT<W, M, A> pass <W, M, A> (WriterT<W, M, (A Value, Func<W, W> Function)> action) Source #
pass
is an action that executes the action
, which returns a value and a
function; it then returns the value with the output having been applied to
the function.
method WriterT<W, M, (A Value, W Output)> listen <W, M, A> (WriterT<W, M, A> ma) Source #
listen
executes the action ma
and adds the result of applying f
to the
output to the value of the computation.
MonadStateT
trait implementation for StateT
type | S | State environment type |
type | M | Given monad trait |
method WriterT<W, M, B> map <W, M, A, B> (Func<A, B> f, K<WriterT<W, 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 WriterT<W, M, B> action <W, M, A, B> (K<WriterT<W, M>, A> ma, K<WriterT<W, M>, B> mb) Source #
Applicative action: runs the first applicative, ignores the result, and returns the second applicative
method WriterT<W, M, B> apply <W, M, A, B> (K<WriterT<W, M>, Func<A, B>> mf, K<WriterT<W, 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 |