Contents
- FinT <M, A> (K<M, Fin<A>> runFin)
- IsSucc
- IsFail
- Match <B> (Func<A, B> Succ, Func<Error, B> Fail)
- Match (Action<A> Succ, Action<Error> Fail)
- IfFail (Func<A> Fail)
- IfFail (Func<Error, A> f)
- IfFail (A value)
- IfFail (Action<Error> Fail)
- IfSucc (Action<A> Succ)
- IfSucc (Error fail)
- IfSucc (Func<Error> Succ)
- IfSucc (Func<A, Error> f)
- MapT <M1, B> (Func<K<M, Fin<A>>, K<M1, Fin<B>>> f)
- MapM <B> (Func<K<M, A>, K<M, B>> f)
- Map <B> (Func<A, B> f)
- MapFail (Func<Error, Error> f)
- Select <B> (Func<A, B> f)
- Bind <B> (Func<A, K<FinT<M>, B>> f)
- Bind <B> (Func<A, Fin<B>> f)
- Bind <B> (Func<A, FinT<M, B>> f)
- Bind <B> (Func<A, Pure<B>> f)
- Bind <B> (Func<A, Fail<Error>> f)
- BiBind <B> (Func<Error, FinT<M, B>> Fail, Func<A, FinT<M, B>> Succ)
- BindFail (Func<Error, FinT<M, A>> Fail)
- SelectMany <B, C> (Func<A, K<FinT<M>, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, FinT<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, Fin<B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, Pure<B>> bind, Func<A, B, C> project)
- ToOption ()
- ToEither ()
- ToValidation ()
- FinT
Sub modules
| Extensions |
| Operators |
| Trait |
record FinT <M, A> (K<M, Fin<A>> runFin) Source #
FinT monad transformer, which allows for either an Error or R result value to be carried.
Parameters
| type | M | Given monad trait |
| type | A | Bound value type |
Properties
Methods
method K<M, B> Match <B> (Func<A, B> Succ, Func<Error, B> Fail) Source #
Invokes the Succ or Fail function depending on the state of the FinT
Parameters
| type | B | Return type |
| param | Fail | Function to invoke if in a Fail state |
| param | Succ | Function to invoke if in a Succ state |
| returns | The return value of the invoked function | |
method K<M, Unit> Match (Action<A> Succ, Action<Error> Fail) Source #
Invokes the Succ or Fail function depending on the state of the FinT
Parameters
| param | Succ | Action to invoke if in a |
| param | Fail | Action to invoke if in a |
| returns | Unit | |
method K<M, A> IfFail (Func<A> Fail) Source #
Executes the Fail function if the Fin is in a Fail state.
Returns the Succ value if the Fin is in a Succ state.
Parameters
| param | Fail | Function to generate a |
| returns | Returns an unwrapped | |
method K<M, A> IfFail (Func<Error, A> f) Source #
Executes the f function if the Fin is in a Fail state.
Returns the Succ value if the Fin is in a Succ state.
Parameters
| param | f | Function to generate a |
| returns | Returns an unwrapped | |
method K<M, A> IfFail (A value) Source #
Returns the value if the Fin is in a Fail state.
Returns the Succ value if the Fin is in a Succ state.
Parameters
| param | value | Value to return if in the Fail state |
| returns | Returns an unwrapped | |
method K<M, Unit> IfFail (Action<Error> Fail) Source #
Executes the Fail action if the Fin is in a Fail state.
Parameters
| param | Fail | Function to generate a |
| returns | Returns an unwrapped Succ value | |
method K<M, Unit> IfSucc (Action<A> Succ) Source #
Invokes the Succ action if the Fin is in a Succ state, otherwise does nothing
Parameters
| param | Succ | Action to invoke |
| returns | Unit | |
method K<M, Error> IfSucc (Error fail) Source #
Returns the fail value if the Fin is in a Succ state.
Returns the Fail value if the Fin is in a Fail state.
Parameters
| param | fail | Value to return if in the |
| returns | Returns an unwrapped | |
method K<M, Error> IfSucc (Func<Error> Succ) Source #
Returns the result of Succ() if the Fin is in a Succ state.
Returns the Fail value if the Fin is in a Fail state.
Parameters
| param | Succ | Function to generate a |
| returns | Returns an unwrapped Fail value | |
method K<M, Error> IfSucc (Func<A, Error> f) Source #
Returns the result of f if the Fin is in a Succ state.
Returns the Fail value if the Fin is in a Fail state.
Parameters
| param | f | Function to generate a |
| returns | Returns an unwrapped Fail value | |
method FinT<M1, B> MapT <M1, B> (Func<K<M, Fin<A>>, K<M1, Fin<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 FinT<M, B> MapM <B> (Func<K<M, A>, K<M, B>> f) Source #
Maps the given monad
Parameters
| param | f | Mapping function |
method FinT<M, 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 FinT<M, A> MapFail (Func<Error, Error> f) Source #
Maps the Error value
Parameters
| type | B | Target bound value type |
| param | f | Mapping function |
| returns |
| |
method FinT<M, 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 FinT<M, B> Bind <B> (Func<A, K<FinT<M>, B>> f) Source #
Monad bind operation
Parameters
| type | B | Target bound value type |
| param | f | Mapping function |
| returns |
| |
method FinT<M, B> Bind <B> (Func<A, Fin<B>> f) Source #
Monad bind operation
Parameters
| type | B | Target bound value type |
| param | f | Mapping function |
| returns |
| |
method FinT<M, B> Bind <B> (Func<A, FinT<M, B>> f) Source #
Monad bind operation
Parameters
| type | B | Target bound value type |
| param | f | Mapping function |
| returns |
| |
method FinT<M, B> Bind <B> (Func<A, Pure<B>> f) Source #
Monad bind operation
Parameters
| type | B | Target bound value type |
| param | f | Mapping function |
| returns |
| |
method FinT<M, B> Bind <B> (Func<A, Fail<Error>> f) Source #
Monad bind operation
Parameters
| type | B | Target bound value type |
| param | f | Mapping function |
| returns |
| |
method FinT<M, B> BiBind <B> (Func<Error, FinT<M, B>> Fail, Func<A, FinT<M, B>> Succ) Source #
Monad bi-bind operation
Parameters
| type | B | Target bound value type |
| param | Fail | Fail state mapping function |
| param | Succ | Fail state mapping function |
| returns |
| |
method FinT<M, A> BindFail (Func<Error, FinT<M, A>> Fail) Source #
Monad bi-bind operation
Parameters
| param | Fail | Fail state mapping function |
| returns |
| |
method FinT<M, C> SelectMany <B, C> (Func<A, K<FinT<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 FinT<M, C> SelectMany <B, C> (Func<A, FinT<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 FinT<M, C> SelectMany <B, C> (Func<A, K<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 FinT<M, C> SelectMany <B, C> (Func<A, Fin<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 FinT<M, 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 ValidationT<Error, M, A> ToValidation () Source #
Methods
method FinT<M, A> Succ <M, A> (A value) Source #
Lift a pure value into the monad-transformer
Parameters
| param | value | Value to lift |
| returns |
| |
method FinT<M, A> Fail <M, A> (Error value) Source #
Lift a fail value into the monad-transformer
Parameters
| param | value | Value to lift |
| returns |
| |
method FinT<M, A> lift <M, A> (Fin<A> ma) Source #
Lifts a given Fin value into the transformer
Parameters
| param | ma |
|
| returns |
| |
method FinT<M, A> lift <M, A> (Pure<A> value) Source #
Lifts a given pure value into the transformer
Parameters
| param | ma | Value to lift |
| returns |
| |
method FinT<M, A> lift <M, A> (Fail<Error> value) Source #
Lifts a given failure value into the transformer
Parameters
| param | fail | Value to lift |
| returns |
| |
method FinT<M, A> lift <M, A> (K<M, A> monad) Source #
Lifts a given monad into the transformer
Parameters
| param | monad | Monad to lift |
| returns |
| |
method FinT<M, A> lift <M, A> (K<M, Fin<A>> ma) Source #
Lifts a given monad into the transformer
Parameters
| param | ma | Monad to lift |
| returns |
| |