Contents
- Try <A> (Func<Fin<A>> runTry)
- Match <B> (Func<A, B> Succ, Func<Error, B> Fail)
- IfFail (Func<Error, A> Fail)
- IfFailM (Func<Error, Fin<A>> Fail)
- Map <B> (Func<A, B> f)
- MapFail (Func<Error, Error> f)
- Select <B> (Func<A, B> f)
- Bind <B> (Func<A, K<Try, B>> f)
- Bind <B> (Func<A, Try<B>> f)
- Bind <B> (Func<A, Pure<B>> f)
- BiBind <B> (Func<A, Try<B>> Succ, Func<Error, Try<B>> Fail)
- BindFail (Func<Error, Try<A>> Fail)
- SelectMany <B, C> (Func<A, K<Try, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, Try<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 ()
- ToFin ()
- ToIO ()
- Combine (Try<A> rhs)
- Try
Sub modules
| Extensions |
| Operators |
| Prelude |
| Trait |
record Try <A> (Func<Fin<A>> runTry) Source #
Try monad which allows for an optional Error result and catches exceptions, converting them to Error.
Parameters
| type | M | Given monad trait |
| type | A | Bound value type |
Methods
method B Match <B> (Func<A, B> Succ, Func<Error, B> Fail) Source #
Match the bound value and return a result (which gets packages back up inside the inner monad)
Parameters
| param | Succ | Success branch |
| param | Fail | Fail branch |
| returns | Inner monad with the result of the | |
method A IfFail (Func<Error, A> Fail) Source #
Match the bound value and return a result (which gets packages back up inside the inner monad)
Parameters
| param | Succ | Success branch |
| param | Fail | Fail branch |
| returns | Inner monad with the result of the | |
method Fin<A> IfFailM (Func<Error, Fin<A>> Fail) Source #
Match the bound value and return a result (which gets packages back up inside the inner monad)
Parameters
| param | Succ | Success branch |
| param | Fail | Fail branch |
| returns | Inner monad with the result of the | |
method Try<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 Try<A> MapFail (Func<Error, Error> f) Source #
Maps the bound value
Parameters
| param | f | Mapping function |
| returns |
| |
method Try<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 Try<B> Bind <B> (Func<A, K<Try, B>> f) Source #
Monad bind operation
Parameters
| type | B | Target bound value type |
| param | f | Mapping function |
| returns |
| |
method Try<B> Bind <B> (Func<A, Try<B>> f) Source #
Monad bind operation
Parameters
| type | B | Target bound value type |
| param | f | Mapping function |
| returns |
| |
method Try<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 Try<B> BiBind <B> (Func<A, Try<B>> Succ, Func<Error, Try<B>> Fail) Source #
Monad bind operation
Parameters
| type | B | Target bound value type |
| param | Succ | Mapping function |
| returns |
| |
method Try<A> BindFail (Func<Error, Try<A>> Fail) Source #
Monad bind operation
Parameters
| type | B | Target bound value type |
| param | Succ | Mapping function |
| returns |
| |
method Try<C> SelectMany <B, C> (Func<A, K<Try, 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 Try<C> SelectMany <B, C> (Func<A, Try<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 Try<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 Try<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 |
| |
Methods
method Try<A> Succ <A> (A value) Source #
Lifts a pure success value into a Try monad
Parameters
| param | value | Value to lift |
| returns |
| |
method Try<A> Fail <A> (Error value) Source #
Lifts a failure value into a Try monad
Parameters
| param | value | Failure value to lift |
| returns |
| |
method Try<A> lift <A> (Func<Fin<A>> f) Source #
Lifts a given function into a Try monad
Parameters
| param | f | Function to lift |
| returns |
| |
method Try<A> lift <A> (Fin<A> ma) Source #
Lifts a given value into a Try monad
Parameters
| param | ma | Value to lift |
| returns |
| |
method Try<A> lift <A> (Pure<A> ma) Source #
Lifts a given value into a Try monad
Parameters
| param | ma | Value to lift |
| returns |
| |
method Try<A> lift <A> (Fail<Error> ma) Source #
Lifts a given value into a Try monad
Parameters
| param | ma | Value to lift |
| returns |
| |