Contents
- EitherT <L, M, R> (K<M, Either<L, R>> runEither)
- Right (R value)
- Left (L value)
- IsRight
- IsLeft
- Lift (Pure<R> pure)
- Lift (Either<L, R> either)
- Lift (Fail<L> fail)
- Lift (K<M, R> monad)
- Lift (K<M, Either<L, R>> monad)
- LiftIO (IO<R> monad)
- LiftIO (IO<Either<L, R>> monad)
- Match <B> (Func<L, B> Left, Func<R, B> Right)
- Match (Action<L> Left, Action<R> Right)
- IfLeft (Func<R> Left)
- IfLeft (Func<L, R> leftMap)
- IfLeft (R rightValue)
- IfLeft (Action<L> Left)
- IfRight (Action<R> Right)
- IfRight (L leftValue)
- IfRight (Func<L> Right)
- IfRight (Func<R, L> rightMap)
- MapT <M1, B> (Func<K<M, Either<L, R>>, K<M1, Either<L, B>>> f)
- MapM <B> (Func<K<M, R>, K<M, B>> f)
- Map <B> (Func<R, B> f)
- MapLeft <B> (Func<L, B> f)
- Select <B> (Func<R, B> f)
- Bind <B> (Func<R, K<EitherT<L, M>, B>> f)
- Bind <B> (Func<R, Either<L, B>> f)
- Bind <B> (Func<R, EitherT<L, M, B>> f)
- Bind <B> (Func<R, IO<B>> f)
- Bind <B> (Func<R, Pure<B>> f)
- Bind <B> (Func<R, Fail<L>> f)
- BiBind <B> (Func<L, EitherT<L, M, B>> Left, Func<R, EitherT<L, M, B>> Right)
- BindLeft (Func<L, EitherT<L, M, R>> Left)
- SelectMany <B, C> (Func<R, K<EitherT<L, M>, B>> bind, Func<R, B, C> project)
- SelectMany <B, C> (Func<R, EitherT<L, M, B>> bind, Func<R, B, C> project)
- SelectMany <B, C> (Func<R, K<M, B>> bind, Func<R, B, C> project)
- SelectMany <B, C> (Func<R, Either<L, B>> bind, Func<R, B, C> project)
- SelectMany <B, C> (Func<R, Pure<B>> bind, Func<R, B, C> project)
- SelectMany <B, C> (Func<R, IO<B>> bind, Func<R, B, C> project)
- SelectMany <C> (Func<R, Guard<L, Unit>> bind, Func<R, Unit, C> project)
- >> (EitherT<L, M, R> lhs, EitherT<L, M, R> rhs)
- >> (EitherT<L, M, R> lhs, K<EitherT<L, M>, R> rhs)
- >> (EitherT<L, M, R> lhs, EitherT<L, M, Unit> rhs)
- >> (EitherT<L, M, R> lhs, K<EitherT<L, M>, Unit> rhs)
- | (EitherT<L, M, R> lhs, EitherT<L, M, R> rhs)
- | (K<EitherT<L, M>, R> lhs, EitherT<L, M, R> rhs)
- | (EitherT<L, M, R> lhs, K<EitherT<L, M>, R> rhs)
- | (EitherT<L, M, R> ma, R b)
- | (EitherT<L, M, R> ma, Pure<R> mb)
- | (EitherT<L, M, R> ma, Fail<L> mb)
- | (EitherT<L, M, R> ma, L mb)
- | (EitherT<L, M, R> ma, CatchM<L, EitherT<L, M>, R> mb)
- ToOption ()
- EitherTExtensions
- As <L, M, A> (this K<EitherT<L, M>, A> ma)
- ToFin <M, A> (this K<EitherT<Error, M>, A> ma)
- Run <L, M, A> (this K<EitherT<L, M>, A> ma)
- Flatten <L, A> (this Task<EitherT<L, IO, A>> tma)
- ToIO <L, A> (this Task<Either<L, A>> ma)
- Flatten <L, M, A> (this EitherT<L, M, EitherT<L, M, A>> mma)
- SelectMany <L, M, A, B, C> ( this K<M, A> ma, Func<A, K<EitherT<L, M>, B>> bind, Func<A, B, C> project)
- SelectMany <L, M, A, B, C> ( this K<M, A> ma, Func<A, EitherT<L, M, B>> bind, Func<A, B, C> project)
- Lefts <L, M, R> (this IEnumerable<EitherT<L, M, R>> self)
- Lefts <L, M, R> (this Seq<EitherT<L, M, R>> self)
- Rights <L, M, R> (this IEnumerable<EitherT<L, M, R>> self)
- Rights <L, M, R> (this Seq<EitherT<L, M, R>> self)
- Partition <L, M, R> (this Seq<EitherT<L, M, R>> self)
- Partition <L, M, R> (this IEnumerable<EitherT<L, M, R>> self)
- EitherTExtensions
- Map <L, M, A, B> (this Func<A, B> f, K<EitherT<L, M>, A> ma)
- Map <L, M, A, B> (this Func<A, B> f, EitherT<L, M, A> ma)
- Action <L, M, A, B> (this EitherT<L, M, A> ma, K<EitherT<L, M>, B> mb)
- Action <L, M, A, B> (this K<EitherT<L, M>, A> ma, K<EitherT<L, M>, B> mb)
- Apply <L, M, A, B> (this EitherT<L, M, Func<A, B>> mf, K<EitherT<L, M>, A> ma)
- Apply <L, M, A, B> (this K<EitherT<L, M>, Func<A, B>> mf, K<EitherT<L, M>, A> ma)
- EitherT <L, M>
- Right <A> (A value)
- Left <A> (L value)
- lift <A> (Either<L, A> ma)
- lift <A> (Pure<A> ma)
- lift <A> (Fail<L> ma)
- liftIO <A> (IO<A> ma)
- EitherT
- Right <L, M, A> (A value)
- Left <L, M, A> (L value)
- lift <L, M, A> (Either<L, A> ma)
- lift <L, M, A> (K<M, A> ma)
- lift <L, M, A> (Pure<A> ma)
- lift <L, M, A> (Fail<L> ma)
- liftIO <L, M, A> (K<IO, A> ma)
- liftIO <L, M, A> (IO<Either<L, A>> ma)
- match <L, M, A, B> (EitherT<L, M, A> ma, Func<L, B> Left, Func<A, B> Right)
- EitherT <L, M>
- Prelude
record EitherT <L, M, R> (K<M, Either<L, R>> runEither) Source #
EitherT monad transformer, which allows for either an L or R result value to be carried.
Parameters
| type | M | Given monad trait |
| type | L | Left value type |
| type | R | Bound value type |
Properties
Methods
method EitherT<L, M, R> Right (R value) Source #
Lift a pure value into the monad-transformer
Parameters
| param | value | Value to lift |
| returns |
| |
method EitherT<L, M, R> Left (L value) Source #
Lift a fail value into the monad-transformer
Parameters
| param | value | Value to lift |
| returns |
| |
method EitherT<L, M, R> Lift (Pure<R> pure) Source #
Lifts a given monad into the transformer
Parameters
| param | pure | Monad to lift |
| returns |
| |
method EitherT<L, M, R> Lift (Either<L, R> either) Source #
Lifts a given monad into the transformer
Parameters
| param | either | Monad to lift |
| returns |
| |
method EitherT<L, M, R> Lift (Fail<L> fail) Source #
Lifts a given monad into the transformer
Parameters
| param | fail | Monad to lift |
| returns |
| |
method EitherT<L, M, R> Lift (K<M, R> monad) Source #
Lifts a given monad into the transformer
Parameters
| param | monad | Monad to lift |
| returns |
| |
method EitherT<L, M, R> Lift (K<M, Either<L, R>> monad) Source #
Lifts a given monad into the transformer
Parameters
| param | monad | Monad to lift |
| returns |
| |
method EitherT<L, M, R> LiftIO (IO<R> monad) Source #
Lifts a given monad into the transformer
Parameters
| param | monad | Monad to lift |
| returns |
| |
method EitherT<L, M, R> LiftIO (IO<Either<L, R>> monad) Source #
Lifts a given monad into the transformer
Parameters
| param | monad | Monad to lift |
| returns |
| |
method K<M, B> Match <B> (Func<L, B> Left, Func<R, B> Right) Source #
Invokes the Right or Left function depending on the state of the Either
Parameters
| type | B | Return type |
| param | Left | Function to invoke if in a Left state |
| param | Right | Function to invoke if in a Right state |
| returns | The return value of the invoked function | |
method K<M, Unit> Match (Action<L> Left, Action<R> Right) Source #
Invokes the Right or Left action depending on the state of the Either
Parameters
| param | Right | Action to invoke if in a Right state |
| param | Left | Action to invoke if in a Left state |
| returns | Unit | |
method K<M, R> IfLeft (Func<R> Left) Source #
Executes the Left function if the Either is in a Left state. Returns the Right value if the Either is in a Right state.
Parameters
| param | Left | Function to generate a Right value if in the Left state |
| returns | Returns an unwrapped Right value | |
method K<M, R> IfLeft (Func<L, R> leftMap) Source #
Executes the leftMap function if the Either is in a Left state. Returns the Right value if the Either is in a Right state.
Parameters
| param | leftMap | Function to generate a Right value if in the Left state |
| returns | Returns an unwrapped Right value | |
method K<M, R> IfLeft (R rightValue) Source #
Returns the rightValue if the Either is in a Left state. Returns the Right value if the Either is in a Right state.
Parameters
| param | rightValue | Value to return if in the Left state |
| returns | Returns an unwrapped Right value | |
method K<M, Unit> IfLeft (Action<L> Left) Source #
Executes the Left action if the Either is in a Left state.
Parameters
| param | Left | Function to generate a Right value if in the Left state |
| returns | Returns an unwrapped Right value | |
method K<M, Unit> IfRight (Action<R> Right) Source #
Invokes the Right action if the Either is in a Right state, otherwise does nothing
Parameters
| param | Right | Action to invoke |
| returns | Unit | |
method K<M, L> IfRight (L leftValue) Source #
Returns the leftValue if the Either is in a Right state. Returns the Left value if the Either is in a Left state.
Parameters
| param | leftValue | Value to return if in the Left state |
| returns | Returns an unwrapped Left value | |
method K<M, L> IfRight (Func<L> Right) Source #
Returns the result of Right() if the Either is in a Right state. Returns the Left value if the Either is in a Left state.
Parameters
| param | Right | Function to generate a Left value if in the Right state |
| returns | Returns an unwrapped Left value | |
method K<M, L> IfRight (Func<R, L> rightMap) Source #
Returns the result of rightMap if the Either is in a Right state. Returns the Left value if the Either is in a Left state.
Parameters
| param | rightMap | Function to generate a Left value if in the Right state |
| returns | Returns an unwrapped Left value | |
method EitherT<L, M1, B> MapT <M1, B> (Func<K<M, Either<L, R>>, K<M1, Either<L, B>>> f) Source #
Maps the bound monad
Parameters
| type | M1 | Target monad type |
| type | B | Target bound value type |
| param | f | Mapping function |
| returns | Mapped monad | |
method EitherT<L, M, B> MapM <B> (Func<K<M, R>, K<M, B>> f) Source #
Maps the given monad
Parameters
| param | f | Mapping function |
method EitherT<L, M, B> Map <B> (Func<R, B> f) Source #
Maps the bound value
Parameters
| type | B | Target bound value type |
| param | f | Mapping function |
| returns |
| |
method EitherT<B, M, R> MapLeft <B> (Func<L, B> f) Source #
Maps the left value
Parameters
| type | B | Target bound value type |
| param | f | Mapping function |
| returns |
| |
method EitherT<L, M, B> Select <B> (Func<R, B> f) Source #
Maps the bound value
Parameters
| type | B | Target bound value type |
| param | f | Mapping transducer |
| returns |
| |
method EitherT<L, M, B> Bind <B> (Func<R, K<EitherT<L, M>, B>> f) Source #
Monad bind operation
Parameters
| type | B | Target bound value type |
| param | f | Mapping function |
| returns |
| |
method EitherT<L, M, B> Bind <B> (Func<R, Either<L, B>> f) Source #
Monad bind operation
Parameters
| type | B | Target bound value type |
| param | f | Mapping function |
| returns |
| |
method EitherT<L, M, B> Bind <B> (Func<R, EitherT<L, M, B>> f) Source #
Monad bind operation
Parameters
| type | B | Target bound value type |
| param | f | Mapping function |
| returns |
| |
method EitherT<L, M, B> Bind <B> (Func<R, IO<B>> f) Source #
Monad bind operation
Parameters
| type | B | Target bound value type |
| param | f | Mapping function |
| returns |
| |
method EitherT<L, M, B> Bind <B> (Func<R, Pure<B>> f) Source #
Monad bind operation
Parameters
| type | B | Target bound value type |
| param | f | Mapping function |
| returns |
| |
method EitherT<L, M, B> Bind <B> (Func<R, Fail<L>> f) Source #
Monad bind operation
Parameters
| type | B | Target bound value type |
| param | f | Mapping function |
| returns |
| |
method EitherT<L, M, B> BiBind <B> (Func<L, EitherT<L, M, B>> Left, Func<R, EitherT<L, M, B>> Right) Source #
Monad bi-bind operation
Parameters
| type | B | Target bound value type |
| param | Left | Left state mapping function |
| param | Right | Left state mapping function |
| returns |
| |
method EitherT<L, M, R> BindLeft (Func<L, EitherT<L, M, R>> Left) Source #
Monad bi-bind operation
Parameters
| param | Left | Left state mapping function |
| returns |
| |
method EitherT<L, M, C> SelectMany <B, C> (Func<R, K<EitherT<L, M>, B>> bind, Func<R, 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 EitherT<L, M, C> SelectMany <B, C> (Func<R, EitherT<L, M, B>> bind, Func<R, 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 EitherT<L, M, C> SelectMany <B, C> (Func<R, K<M, B>> bind, Func<R, 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 EitherT<L, M, C> SelectMany <B, C> (Func<R, Either<L, B>> bind, Func<R, 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 EitherT<L, M, C> SelectMany <B, C> (Func<R, Pure<B>> bind, Func<R, 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 EitherT<L, M, C> SelectMany <B, C> (Func<R, IO<B>> bind, Func<R, 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 EitherT<L, M, C> SelectMany <C> (Func<R, Guard<L, Unit>> bind, Func<R, Unit, 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 >> (EitherT<L, M, R> lhs, EitherT<L, M, R> 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 >> (EitherT<L, M, R> lhs, K<EitherT<L, M>, R> 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 >> (EitherT<L, M, R> lhs, EitherT<L, 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.
Parameters
| param | lhs | First action to run |
| param | rhs | Second action to run |
| returns | Result of the first action | |
operator >> (EitherT<L, M, R> lhs, K<EitherT<L, 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.
Parameters
| param | lhs | First action to run |
| param | rhs | Second action to run |
| returns | Result of the first action | |
class EitherTExtensions Source #
EitherT monad-transformer extensions
Methods
method K<M, Either<L, A>> Run <L, M, A> (this K<EitherT<L, M>, A> ma) Source #
Runs the EitherT exposing the outer monad with an inner wrapped Either
method EitherT<L, IO, A> Flatten <L, A> (this Task<EitherT<L, IO, A>> tma) Source #
Get the outer task and wrap it up in a new IO within the EitherT IO
method EitherT<L, M, A> Flatten <L, M, A> (this EitherT<L, M, EitherT<L, M, A>> mma) Source #
Monadic join
method EitherT<L, M, C> SelectMany <L, M, A, B, C> ( this K<M, A> ma, Func<A, K<EitherT<L, M>, 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 EitherT<L, M, C> SelectMany <L, M, A, B, C> ( this K<M, A> ma, Func<A, EitherT<L, M, 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 K<M, Seq<L>> Lefts <L, M, R> (this IEnumerable<EitherT<L, M, R>> self) Source #
Extracts from a list of 'Either' all the 'Left' elements. All the 'Left' elements are extracted in order.
Parameters
| type | L | Left |
| type | R | Right |
| param | self | Either list |
| returns | An enumerable of L | |
method K<M, Seq<L>> Lefts <L, M, R> (this Seq<EitherT<L, M, R>> self) Source #
Extracts from a list of 'Either' all the 'Left' elements. All the 'Left' elements are extracted in order.
Parameters
| type | L | Left |
| type | R | Right |
| param | self | Either list |
| returns | An enumerable of L | |
method K<M, Seq<R>> Rights <L, M, R> (this IEnumerable<EitherT<L, M, R>> self) Source #
Extracts from a list of 'Either' all the 'Right' elements. All the 'Right' elements are extracted in order.
Parameters
| type | L | Left |
| type | R | Right |
| param | self | Either list |
| returns | An enumerable of L | |
method K<M, Seq<R>> Rights <L, M, R> (this Seq<EitherT<L, M, R>> self) Source #
Extracts from a list of 'Either' all the 'Right' elements. All the 'Right' elements are extracted in order.
Parameters
| type | L | Left |
| type | R | Right |
| param | self | Either list |
| returns | An enumerable of L | |
method K<M, (Seq<L> Lefts, Seq<R> Rights)> Partition <L, M, R> (this Seq<EitherT<L, M, R>> self) Source #
Partitions a list of 'Either' into two lists. All the 'Left' elements are extracted, in order, to the first component of the output. Similarly, the 'Right' elements are extracted to the second component of the output.
Parameters
| type | L | Left |
| type | R | Right |
| param | self | Either list |
| returns | A tuple containing the enumerable of L and enumerable of R | |
method K<M, (Seq<L> Lefts, Seq<R> Rights)> Partition <L, M, R> (this IEnumerable<EitherT<L, M, R>> self) Source #
Partitions a list of 'Either' into two lists. All the 'Left' elements are extracted, in order, to the first component of the output. Similarly, the 'Right' elements are extracted to the second component of the output.
Parameters
| type | L | Left |
| type | R | Right |
| param | self | Either list |
| returns | A tuple containing the enumerable of L and enumerable of R | |
class EitherTExtensions Source #
Methods
method EitherT<L, M, B> Map <L, M, A, B> (this Func<A, B> f, K<EitherT<L, 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.
Parameters
| param | ma | Functor to map |
| param | f | Mapping function |
| returns | Mapped functor | |
method EitherT<L, M, B> Map <L, M, A, B> (this Func<A, B> f, EitherT<L, 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.
Parameters
| param | ma | Functor to map |
| param | f | Mapping function |
| returns | Mapped functor | |
method EitherT<L, M, B> Action <L, M, A, B> (this EitherT<L, M, A> ma, K<EitherT<L, M>, B> mb) Source #
Applicative action: runs the first applicative, ignores the result, and returns the second applicative
method EitherT<L, M, B> Action <L, M, A, B> (this K<EitherT<L, M>, A> ma, K<EitherT<L, M>, B> mb) Source #
Applicative action: runs the first applicative, ignores the result, and returns the second applicative
method EitherT<L, M, B> Apply <L, M, A, B> (this EitherT<L, M, Func<A, B>> mf, K<EitherT<L, 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.
Parameters
| param | ma | Value(s) applicative functor |
| param | mf | Mapping function(s) |
| returns | Mapped applicative functor | |
method EitherT<L, M, B> Apply <L, M, A, B> (this K<EitherT<L, M>, Func<A, B>> mf, K<EitherT<L, 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.
Parameters
| param | ma | Value(s) applicative functor |
| param | mf | Mapping function(s) |
| returns | Mapped applicative functor | |
Methods
Methods
Trait implementation for EitherT
Parameters
| type | M | Given monad trait |
Methods
method EitherT<L, M, B> map <L, M, A, B> (Func<A, B> f, K<EitherT<L, 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.
Parameters
| param | ma | Functor to map |
| param | f | Mapping function |
| returns | Mapped functor | |
method EitherT<L, M, B> action <L, M, A, B> (K<EitherT<L, M>, A> ma, K<EitherT<L, M>, B> mb) Source #
Applicative action: runs the first applicative, ignores the result, and returns the second applicative
method EitherT<L, M, B> apply <L, M, A, B> (K<EitherT<L, M>, Func<A, B>> mf, K<EitherT<L, 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.
Parameters
| param | ma | Value(s) applicative functor |
| param | mf | Mapping function(s) |
| returns | Mapped applicative functor | |