LanguageExt.Core

LanguageExt.Core Monads Alternative Monads Try

Contents

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 Succ or Fail branches

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 Succ or Fail branches

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 Succ or Fail branches

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

TryT

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

Maps the bound value

Parameters

param f

Mapping function

returns

TryT

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

TryT

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

TryT

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

TryT

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

TryT

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

TryT

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

TryT

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

TryT

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

TryT

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

TryT

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

TryT

method Option<A> ToOption () Source #

method Either<Error, A> ToEither () Source #

method Fin<A> ToFin () Source #

method IO<A> ToIO () Source #

method Try<A> Combine (Try<A> rhs) Source #

class Try Source #

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

Try

method Try<A> Fail <A> (Error value) Source #

Lifts a failure value into a Try monad

Parameters

param value

Failure value to lift

returns

Try

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

Try

method Try<A> lift <A> (Fin<A> ma) Source #

Lifts a given value into a Try monad

Parameters

param ma

Value to lift

returns

Try

method Try<A> lift <A> (Pure<A> ma) Source #

Lifts a given value into a Try monad

Parameters

param ma

Value to lift

returns

Try

method Try<A> lift <A> (Fail<Error> ma) Source #

Lifts a given value into a Try monad

Parameters

param ma

Value to lift

returns

Try

method Try<A> lift <A> (Func<A> f) Source #

Lifts a given function into a Try monad

Parameters

param f

Function to lift

returns

Try

method Try<Unit> lift (Action f) Source #

Lifts a given function into a Try monad

Parameters

param f

Function to lift

returns

Try