Contents
- FinT <M, A> (K<M, Fin<A>> runFin)
- Succ (A value)
- Fail (Error value)
- IsSucc
- IsFail
- Lift (Pure<A> pure)
- Lift (Fin<A> ma)
- Lift (Fail<Error> fail)
- Lift (Error fail)
- Lift (K<M, A> monad)
- Lift (K<M, Fin<A>> monad)
- LiftIO (IO<A> monad)
- LiftIO (IO<Fin<A>> monad)
- 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, IO<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)
- SelectMany <B, C> (Func<A, IO<B>> bind, Func<A, B, C> project)
- >> (FinT<M, A> lhs, FinT<M, A> rhs)
- >> (FinT<M, A> lhs, K<FinT<M>, A> rhs)
- >> (FinT<M, A> lhs, FinT<M, Unit> rhs)
- >> (FinT<M, A> lhs, K<FinT<M>, Unit> rhs)
- + (FinT<M, A> lhs, FinT<M, A> rhs)
- + (K<FinT<M>, A> lhs, FinT<M, A> rhs)
- + (FinT<M, A> lhs, K<FinT<M>, A> rhs)
- + (FinT<M, A> lhs, A rhs)
- + (FinT<M, A> ma, Pure<A> mb)
- + (FinT<M, A> ma, Fail<Error> mb)
- + (FinT<M, A> ma, Fail<Exception> mb)
- | (FinT<M, A> lhs, FinT<M, A> rhs)
- | (K<FinT<M>, A> lhs, FinT<M, A> rhs)
- | (FinT<M, A> lhs, K<FinT<M>, A> rhs)
- | (FinT<M, A> lhs, A rhs)
- | (FinT<M, A> ma, Pure<A> mb)
- | (FinT<M, A> ma, Fail<Error> mb)
- | (FinT<M, A> ma, Fail<Exception> mb)
- | (FinT<M, A> ma, Error mb)
- | (FinT<M, A> ma, CatchM<Error, FinT<M>, A> mb)
- ToOption ()
- ToEither ()
- ToValidation ()
- FinTExtensions
- As <M, A> (this K<FinT<M>, A> ma)
- Run <M, A> (this K<FinT<M>, A> ma)
- Flatten <A> (this Task<FinT<IO, A>> tma)
- ToIO <M, A> (this Task<Fin<A>> ma)
- Flatten <M, A> (this FinT<M, FinT<M, A>> mma)
- SelectMany <M, A, B, C> ( this K<M, A> ma, Func<A, K<FinT<M>, B>> bind, Func<A, B, C> project)
- SelectMany <M, A, B, C> ( this K<M, A> ma, Func<A, FinT<M, B>> bind, Func<A, B, C> project)
- Fails <M, A> (this IEnumerable<FinT<M, A>> self)
- Fails <M, R> (this Seq<FinT<M, R>> self)
- Succs <M, A> (this IEnumerable<FinT<M, A>> self)
- Succs <M, A> (this Seq<FinT<M, A>> self)
- Partition <M, A> (this Seq<FinT<M, A>> self)
- Partition <M, A> (this IEnumerable<FinT<M, A>> self)
- FinTExtensions
- Map <M, A, B> (this Func<A, B> f, K<FinT<M>, A> ma)
- Map <M, A, B> (this Func<A, B> f, FinT<M, A> ma)
- Action <M, A, B> (this FinT<M, A> ma, FinT<M, B> mb)
- Apply <M, A, B> (this FinT<M, Func<A, B>> mf, K<FinT<M>, A> ma)
- Apply <M, A, B> (this K<FinT<M>, Func<A, B>> mf, K<FinT<M>, A> ma)
- FinT <M>
- Succ <A> (A value)
- Fail <A> (Error value)
- lift <A> (Fin<A> ma)
- lift <A> (Pure<A> ma)
- lift <A> (Fail<Error> ma)
- liftIO <A> (IO<A> ma)
- FinT
- bind <M, A, B> (FinT<M, A> ma, Func<A, FinT<M, B>> f)
- map <M, A, B> (Func<A, B> f, FinT<M, A> ma)
- Succ <M, A> (A value)
- Fail <M, A> (Error value)
- lift <M, A> (Fin<A> ma)
- lift <M, A> (Either<Error, A> ma)
- lift <M, A> (K<M, A> ma)
- lift <M, A> (Pure<A> ma)
- lift <M, A> (Fail<Error> ma)
- liftIO <M, A> (IO<A> ma)
- match <M, A, B> (FinT<M, A> ma, Func<A, B> Succ, Func<Error, B> Fail)
- FinT <M>
- Prelude
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 FinT<M, A> Succ (A value) Source #
Lift a pure value into the monad-transformer
Parameters
| param | value | Value to lift |
| returns |
| |
method FinT<M, A> Fail (Error value) Source #
Lift a fail value into the monad-transformer
Parameters
| param | value | Value to lift |
| returns |
| |
method FinT<M, A> Lift (Pure<A> pure) Source #
Lifts a given monad into the transformer
Parameters
| param | pure | Monad to lift |
| returns |
| |
method FinT<M, A> Lift (Fin<A> ma) Source #
Lifts a given monad into the transformer
Parameters
| param | ma | Monad to lift |
| returns |
| |
method FinT<M, A> Lift (Fail<Error> fail) Source #
Lifts a given monad into the transformer
Parameters
| param | fail | Monad to lift |
| returns |
| |
method FinT<M, A> Lift (Error fail) Source #
Lifts a given monad into the transformer
Parameters
| param | fail | Fail value |
| returns |
| |
method FinT<M, A> Lift (K<M, A> monad) Source #
Lifts a given monad into the transformer
Parameters
| param | monad | Monad to lift |
| returns |
| |
method FinT<M, A> Lift (K<M, Fin<A>> monad) Source #
Lifts a given monad into the transformer
Parameters
| param | monad | Monad to lift |
| returns |
| |
method FinT<M, A> LiftIO (IO<A> monad) Source #
Lifts a given monad into the transformer
Parameters
| param | monad | Monad to lift |
| returns |
| |
method FinT<M, A> LiftIO (IO<Fin<A>> monad) Source #
Lifts a given monad into the transformer
Parameters
| param | monad | Monad to lift |
| returns |
| |
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, IO<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 FinT<M, C> SelectMany <B, C> (Func<A, IO<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 #
Operators
operator >> (FinT<M, A> lhs, FinT<M, 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 >> (FinT<M, A> lhs, K<FinT<M>, 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 >> (FinT<M, A> lhs, FinT<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 FinTExtensions Source #
Either monad extensions
Methods
method K<M, Fin<A>> Run <M, A> (this K<FinT<M>, A> ma) Source #
Runs the FinT exposing the outer monad with an inner wrapped Fin
method FinT<IO, A> Flatten <A> (this Task<FinT<IO, A>> tma) Source #
Get the outer task and wrap it up in a new IO within the EitherT IO
method FinT<M, A> Flatten <M, A> (this FinT<M, FinT<M, A>> mma) Source #
Monadic join
method FinT<M, C> SelectMany <M, A, B, C> ( this K<M, A> ma, 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 <M, A, B, C> ( this K<M, A> ma, 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 K<M, Seq<Error>> Fails <M, A> (this IEnumerable<FinT<M, A>> self) Source #
Extracts from a sequence of 'Fin' transformers all the 'Fail' values. The 'Fail' elements are extracted in order.
Parameters
| type | A | Success value type |
| param | self | Sequence of Fin transformers |
| returns | A sequence of errors | |
method K<M, Seq<Error>> Fails <M, R> (this Seq<FinT<M, R>> self) Source #
Extracts from a sequence of 'Fin' transformers all the 'Fail' values. The 'Fail' elements are extracted in order.
Parameters
| type | A | Success value type |
| param | self | Sequence of Fin transformers |
| returns | A sequence of errors | |
method K<M, Seq<A>> Succs <M, A> (this IEnumerable<FinT<M, A>> self) Source #
Extracts from a sequence of 'Fin' transformers all the 'Succ' values. The 'Succ' elements are extracted in order.
Parameters
| type | A | Success value type |
| param | self | Sequence of Fin transformers |
| returns | A sequence of success values | |
method K<M, Seq<A>> Succs <M, A> (this Seq<FinT<M, A>> self) Source #
Extracts from a sequence of 'Fin' transformers all the 'Succ' values. The 'Succ' elements are extracted in order.
Parameters
| type | A | Success value type |
| param | self | Sequence of Fin transformers |
| returns | A sequence of success values | |
method K<M, (Seq<Error> Lefts, Seq<A> Rights)> Partition <M, A> (this Seq<FinT<M, A>> self) Source #
Partitions a sequence of 'FinT' transformers into two sequences. All the 'Fail' elements are extracted, in order, to the first component of the output. Similarly, the 'Succ' elements are extracted to the second component of the output.
Parameters
| type | A | Success type |
| param | self | Sequence of Fin transformers |
| returns | A tuple containing a sequence of | |
method K<M, (Seq<Error> Lefts, Seq<A> Rights)> Partition <M, A> (this IEnumerable<FinT<M, A>> self) Source #
Partitions a sequence of 'FinT' transformers into two sequences. All the 'Fail' elements are extracted, in order, to the first component of the output. Similarly, the 'Succ' elements are extracted to the second component of the output.
Parameters
| type | A | Success type |
| param | self | Sequence of Fin transformers |
| returns | A tuple containing a sequence of | |
class FinTExtensions Source #
Methods
method FinT<M, B> Map <M, A, B> (this Func<A, B> f, K<FinT<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 FinT<M, B> Map <M, A, B> (this Func<A, B> f, FinT<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 FinT<M, B> Action <M, A, B> (this FinT<M, A> ma, FinT<M, B> mb) Source #
Applicative action: runs the first applicative, ignores the result, and returns the second applicative
method FinT<M, B> Apply <M, A, B> (this FinT<M, Func<A, B>> mf, K<FinT<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 FinT<M, B> Apply <M, A, B> (this K<FinT<M>, Func<A, B>> mf, K<FinT<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 FinT
Parameters
| type | M | Given monad trait |
Methods
method FinT<M, B> map <M, A, B> (Func<A, B> f, K<FinT<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 FinT<M, B> action <M, A, B> (K<FinT<M>, A> ma, K<FinT<M>, B> mb) Source #
Applicative action: runs the first applicative, ignores the result, and returns the second applicative
method FinT<M, B> apply <M, A, B> (K<FinT<M>, Func<A, B>> mf, K<FinT<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 | |