Contents
- Reader <Env, A> (Func<Env, A> runReader)
- Pure (A value)
- Asks (Func<Env, A> f)
- AsksM (Func<Env, Reader<Env, A>> f)
- Lift (Pure<A> monad)
- Lift (Func<A> f)
- With <Env1> (Func<Env1, Env> f)
- Local (Func<Env, Env> f)
- Map <B> (Func<A, B> f)
- Select <B> (Func<A, B> f)
- Bind <B> (Func<A, K<Reader<Env>, B>> f)
- Bind <B> (Func<A, Reader<Env, B>> f)
- Bind <B> (Func<A, Ask<Env, B>> f)
- SelectMany <B, C> (Func<A, K<Reader<Env>, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, Reader<Env, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, Pure<B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, Ask<Env, B>> bind, Func<A, B, C> project)
- >> (Reader<Env, A> lhs, Reader<Env, A> rhs)
- >> (Reader<Env, A> lhs, K<Reader<Env>, A> rhs)
- >> (Reader<Env, A> lhs, Reader<Env, Unit> rhs)
- >> (Reader<Env, A> lhs, K<Reader<Env>, Unit> rhs)
- Run (Env env)
- ReaderExtensions
- As <Env, A> (this K<Reader<Env>, A> ma)
- Run <Env, A> (this K<Reader<Env>, A> ma, Env env)
- Flatten <Env, A> (this Reader<Env, Reader<Env, A>> mma)
- ReaderExtensions
- Map <Env, A, B> (this Func<A, B> f, K<Reader<Env>, A> ma)
- Map <Env, A, B> (this Func<A, B> f, Reader<Env, A> ma)
- Action <Env, A, B> (this Reader<Env, A> ma, K<Reader<Env>, B> mb)
- Action <Env, A, B> (this K<Reader<Env>, A> ma, K<Reader<Env>, B> mb)
- Apply <Env, A, B> (this Reader<Env, Func<A, B>> mf, K<Reader<Env>, A> ma)
- Apply <Env, A, B> (this K<Reader<Env>, Func<A, B>> mf, K<Reader<Env>, A> ma)
- Reader
- pure <Env, A> (A value)
- ask <Env> ()
- asks <Env, A> (Func<Env, A> f)
- asksM <Env, A> (Func<Env, Reader<Env, A>> f)
- local <Env, A> (Func<Env, Env> f, Reader<Env, A> ma)
- Reader <Env>
- Prelude
record Reader <Env, A> (Func<Env, A> runReader) Source #
Reader
monad transformer, which adds a static environment to a given monad.
Parameters
type | Env | Reader environment type |
type | M | Given monad trait |
type | A | Bound value type |
Methods
method Reader<Env, A> Pure (A value) Source #
Lift a pure value into the monad-transformer
Parameters
param | value | Value to lift |
returns |
|
method Reader<Env, A> Asks (Func<Env, A> f) Source #
Extracts the environment value and maps it to the bound value
Parameters
param | f | Environment mapping function |
returns |
|
method Reader<Env, A> AsksM (Func<Env, Reader<Env, A>> f) Source #
Extracts the environment value and maps it to the bound value
Parameters
param | f | Environment mapping function |
returns |
|
method Reader<Env, A> Lift (Pure<A> monad) Source #
Lifts a given monad into the transformer
Parameters
param | monad | Monad to lift |
returns |
|
method Reader<Env, A> Lift (Func<A> f) Source #
Lifts a unit function into the transformer
Parameters
param | f | Function to lift |
returns |
|
method Reader<Env1, A> With <Env1> (Func<Env1, Env> f) Source #
Maps the Reader's environment value
Parameters
param | f | Mapping function |
returns |
|
method Reader<Env, A> Local (Func<Env, Env> f) Source #
Maps the Reader's environment value
Parameters
param | f | Mapping function |
returns |
|
method Reader<Env, B> Map <B> (Func<A, B> f) Source #
Maps the bound value
Parameters
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method Reader<Env, B> Select <B> (Func<A, B> f) Source #
Maps the bound value
Parameters
type | B | Target bound value type |
param | f | Mapping transducer |
returns |
|
method Reader<Env, B> Bind <B> (Func<A, K<Reader<Env>, B>> f) Source #
Monad bind operation
Parameters
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method Reader<Env, B> Bind <B> (Func<A, Reader<Env, B>> f) Source #
Monad bind operation
Parameters
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method Reader<Env, B> Bind <B> (Func<A, Ask<Env, B>> f) Source #
Monad bind operation
Parameters
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method Reader<Env, C> SelectMany <B, C> (Func<A, K<Reader<Env>, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
Parameters
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method Reader<Env, C> SelectMany <B, C> (Func<A, Reader<Env, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
Parameters
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method Reader<Env, C> SelectMany <B, C> (Func<A, Pure<B>> bind, Func<A, B, C> project) Source #
Monad bind operation
Parameters
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method Reader<Env, C> SelectMany <B, C> (Func<A, Ask<Env, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
Parameters
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
Operators
operator >> (Reader<Env, A> lhs, Reader<Env, A> rhs) Source #
Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in C#.
Parameters
param | lhs | First action to run |
param | rhs | Second action to run |
returns | Result of the second action |
operator >> (Reader<Env, A> lhs, K<Reader<Env>, A> rhs) Source #
Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in C#.
Parameters
param | lhs | First action to run |
param | rhs | Second action to run |
returns | Result of the second action |
operator >> (Reader<Env, A> lhs, Reader<Env, Unit> rhs) Source #
Sequentially compose two actions. The second action is a unit returning action, so the result of the first action is propagated.
Parameters
param | lhs | First action to run |
param | rhs | Second action to run |
returns | Result of the first action |
operator >> (Reader<Env, A> lhs, K<Reader<Env>, Unit> rhs) Source #
Sequentially compose two actions. The second action is a unit returning action, so the result of the first action is propagated.
Parameters
param | lhs | First action to run |
param | rhs | Second action to run |
returns | Result of the first action |
class ReaderExtensions Source #
Reader monad extensions
class ReaderExtensions Source #
Methods
method Reader<Env, B> Map <Env, A, B> (this Func<A, B> f, K<Reader<Env>, 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.
Parameters
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method Reader<Env, B> Map <Env, A, B> (this Func<A, B> f, Reader<Env, 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.
Parameters
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method Reader<Env, B> Action <Env, A, B> (this Reader<Env, A> ma, K<Reader<Env>, B> mb) Source #
Applicative action: runs the first applicative, ignores the result, and returns the second applicative
method Reader<Env, B> Action <Env, A, B> (this K<Reader<Env>, A> ma, K<Reader<Env>, B> mb) Source #
Applicative action: runs the first applicative, ignores the result, and returns the second applicative
method Reader<Env, B> Apply <Env, A, B> (this Reader<Env, Func<A, B>> mf, K<Reader<Env>, 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.
Parameters
param | ma | Value(s) applicative functor |
param | mf | Mapping function(s) |
returns | Mapped applicative functor |
method Reader<Env, B> Apply <Env, A, B> (this K<Reader<Env>, Func<A, B>> mf, K<Reader<Env>, 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.
Parameters
param | ma | Value(s) applicative functor |
param | mf | Mapping function(s) |
returns | Mapped applicative functor |
Methods
Trait implementation for Reader
Parameters
type | Env | Reader environment type |
Methods
method Reader<Env, B> map <Env, A, B> (Func<A, B> f, K<Reader<Env>, 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.
Parameters
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method Reader<Env, B> action <Env, A, B> (K<Reader<Env>, A> ma, K<Reader<Env>, B> mb) Source #
Applicative action: runs the first applicative, ignores the result, and returns the second applicative
method Reader<Env, B> apply <Env, A, B> (K<Reader<Env>, Func<A, B>> mf, K<Reader<Env>, 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.
Parameters
param | ma | Value(s) applicative functor |
param | mf | Mapping function(s) |
returns | Mapped applicative functor |