LanguageExt.Core

LanguageExt.Core Monads Alternative Monads TryT

Contents

Sub modules

Extensions
Operators
Prelude
Trait

record TryT <M, A> (K<M, Try<A>> runTry) Source #

where M : Monad<M>

TryT monad transformer, 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 K<M, 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 Succ or Fail branches

method K<M, 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 Succ or Fail branches

method K<M, A> IfFailM (Func<Error, K<M, 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 Succ or Fail branches

method TryT<M1, B> MapT <M1, B> (Func<K<M, Fin<A>>, K<M1, Fin<B>>> f) Source #

where M1 : Monad<M1>

Maps the bound monad

Parameters

type M1

Target monad type

type B

Target bound value type

param f

Mapping function

returns

Mapped monad

method TryT<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

TryT

method TryT<M, A> MapFail (Func<Error, Error> f) Source #

Maps the bound value

Parameters

param f

Mapping function

returns

TryT

method TryT<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

TryT

method TryT<M, B> Bind <B> (Func<A, K<TryT<M>, B>> f) Source #

Monad bind operation

Parameters

type B

Target bound value type

param f

Mapping function

returns

TryT

method TryT<M, B> Bind <B> (Func<A, TryT<M, B>> f) Source #

Monad bind operation

Parameters

type B

Target bound value type

param f

Mapping function

returns

TryT

method TryT<M, B> BiBind <B> (Func<A, TryT<M, B>> Succ, Func<Error, TryT<M, B>> Fail) Source #

Monad bind operation

Parameters

type B

Target bound value type

param Succ

Success mapping function

param Fail

Failure mapping function

returns

TryT

method TryT<M, A> BindFail (Func<Error, TryT<M, A>> Fail) Source #

Monad bind operation

Parameters

type B

Target bound value type

param Fail

Failure mapping function

returns

TryT

method TryT<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

TryT

method TryT<M, C> SelectMany <B, C> (Func<A, K<TryT<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

TryT

method TryT<M, C> SelectMany <B, C> (Func<A, TryT<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

TryT

method TryT<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

TryT

method TryT<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

TryT

method TryT<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

TryT

method TryT<M, A> Combine (TryT<M, A> rhs) Source #

class TryT Source #

Methods

method TryT<M, A> Succ <M, A> (A value) Source #

where M : Monad<M>

Lift a pure success value into the monad-transformer

Parameters

param value

Value to lift

returns

TryT

method TryT<M, A> Fail <M, A> (Error value) Source #

where M : Monad<M>

Lift a fail value into the monad-transformer

Parameters

param value

Value to lift

returns

TryT

method TryT<M, A> lift <M, A> (K<M, A> ma) Source #

where M : Monad<M>

Lifts a given monad into the transformer

Parameters

param ma

Monad to lift

returns

TryT

method TryT<M, A> lift <M, A> (Func<Fin<A>> f) Source #

where M : Monad<M>

Lifts a given lazy-value into the transformer

Parameters

param f

Lazy value to lift

returns

TryT

method TryT<M, A> lift <M, A> (Fin<A> ma) Source #

where M : Monad<M>

Lifts a given value into the transformer

Parameters

param ma

Value to lift

returns

TryT

method TryT<M, A> lift <M, A> (Pure<A> ma) Source #

where M : Monad<M>

Lifts a given value into the transformer

Parameters

param ma

Value to lift

returns

TryT

method TryT<M, A> lift <M, A> (Fail<Error> ma) Source #

where M : Monad<M>

Lifts a given value into the transformer

Parameters

param ma

Value to lift

returns

TryT

method TryT<M, A> liftIO <M, A> (IO<A> ma) Source #

where M : MonadIO<M>

Lifts a given IO monad into the TryT transformer

Parameters

param ma

IO monad to lift

returns

TryT