Contents
- EitherT <L, M, R> (K<M, Either<L, R>> runEither)
- IsRight
- IsLeft
- 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)
- Select <B> (Func<R, B> f)
- MapLeft <B> (Func<L, B> f)
- BiMap <L1, R1> ( Func<L, L1> Left, Func<R, R1> Right)
- 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, Pure<B>> f)
- Bind <B> (Func<R, Fail<L>> f)
- BindLeft <L1> (Func<L, K<EitherT<M>, L1, R>> f)
- BindRight <R1> (Func<R, K<EitherT<M>, L, R1>> f)
- 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)
- ToOption ()
- EitherT
Sub modules
| Extensions |
| Operators |
| Trait |
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 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 | Mapped structure | |
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 | Mapped structure | |
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 | Mapped structure | |
method EitherT<L1, M, R1> BiMap <L1, R1> ( Func<L, L1> Left, Func<R, R1> Right) Source #
Bifunctor map operation
Parameters
| type | L1 | Target left type |
| type | R1 | Target right type |
| param | Left | Left map function |
| param | Right | Right map function |
| returns | Mapped structure | |
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, 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<L1, M, R> BindLeft <L1> (Func<L, K<EitherT<M>, L1, R>> f) Source #
Bimonad bind left
Parameters
| type | L1 | |
| param | f | |
| returns | ||
method EitherT<L, M, R1> BindRight <R1> (Func<R, K<EitherT<M>, L, R1>> f) Source #
Bimonad bind right
Parameters
| type | L1 | |
| param | f | |
| 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 |
| |
Methods
method EitherT<L, M, A> Right <L, M, A> (A value) Source #
Lift a pure value into the monad-transformer
Parameters
| param | value | Value to lift |
| returns |
| |
method EitherT<L, M, A> Left <L, M, A> (L value) Source #
Lift a fail value into the monad-transformer
Parameters
| param | value | Value to lift |
| returns |
| |
method EitherT<L, M, A> lift <L, M, A> (Either<L, A> value) Source #
Lifts a given Either value into the transformer
Parameters
| param | value | Value to lift |
| returns |
| |
method EitherT<L, M, A> lift <L, M, A> (K<M, A> ma) Source #
Lifts a given monad into the transformer
Parameters
| param | ma | Monad to lift |
| returns |
| |
method EitherT<L, M, A> lift <L, M, A> (K<M, Either<L, A>> ma) Source #
Lifts a given monad into the transformer
Parameters
| param | ma | Monad to lift |
| returns |
| |
method EitherT<L, M, A> lift <L, M, A> (Pure<A> ma) Source #
Lifts a given value into the transformer
Parameters
| param | pure | Value to lift |
| returns |
| |
method EitherT<L, M, A> lift <L, M, A> (Fail<L> ma) Source #
Lifts a given value into the transformer
Parameters
| param | fail | Value to lift |
| returns |
| |