LanguageExt.Core

LanguageExt.Core Traits Fallible

Contents

class FallibleExtensions Source #

Extensions for higher-kinded structures that have a failure state Error

Parameters

type F

Higher-kinded structure

Methods

method K<F, A> Catch <F, A> ( this K<F, A> fa, Func<Error, bool> Predicate, Func<Error, K<F, A>> Fail) Source #

where F : Fallible<F>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Predicate

Predicate to test any failure values

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<M, A> CatchIO <M, A> ( this K<M, A> ma, Func<Error, bool> Predicate, Func<Error, K<IO, A>> Fail) Source #

where M : Fallible<M>, Monad<M>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param ma

Fallible structure

param Predicate

Predicate to test any failure values

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <F, A> ( this K<F, A> fa, Func<Error, bool> Predicate, Func<Error, Error> Fail) Source #

where F : Fallible<F>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Predicate

Predicate to test any failure values

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <F, A> ( this K<F, A> fa, Func<Error, bool> Predicate, Func<Error, A> Fail) Source #

where F : Fallible<F>, Applicative<F>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Predicate

Predicate to test any failure values

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <F, A> ( this K<F, A> fa, CatchM<Error, F, A> @catch) Source #

where F : Fallible<F>

Run the Fallible structure. If in a failed state, test the failure value against the catch structure and run its action if a match.

Parameters

type A

Bound value type

param fa

Fallible structure

param @catch

Catch structure created by the @catch functions. Contains the match predicate and action

returns

Either fa or the result of running the catch structure's action if fa is in a failed state and the

method K<F, A> Catch <F, A> ( this K<F, A> fa, Error Match, Func<Error, K<F, A>> Fail) Source #

where F : Fallible<F>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Match

Error to match to

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<M, A> CatchIO <M, A> ( this K<M, A> ma, Error Match, Func<Error, K<IO, A>> Fail) Source #

where M : Fallible<M>, Monad<M>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param ma

Fallible structure

param Match

Error to match to

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <F, A> ( this K<F, A> fa, Error Match, Func<Error, Error> Fail) Source #

where F : Fallible<F>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Match

Error to match to

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <F, A> ( this K<F, A> fa, Error Match, Func<Error, A> Fail) Source #

where F : Fallible<F>, Applicative<F>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Match

Error to match to

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <F, A> ( this K<F, A> fa, int Code, Func<Error, K<F, A>> Fail) Source #

where F : Fallible<F>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Code

Error code to match to

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<M, A> CatchIO <M, A> ( this K<M, A> ma, int Code, Func<Error, K<IO, A>> Fail) Source #

where M : Fallible<M>, Monad<M>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param ma

Fallible structure

param Code

Error code to match to

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <F, A> ( this K<F, A> fa, int Code, Func<Error, Error> Fail) Source #

where F : Fallible<F>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Code

Error code to match to

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <F, A> ( this K<F, A> fa, int Code, Func<Error, A> Fail) Source #

where F : Fallible<F>, Applicative<F>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Code

Error code to match to

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <F, A> ( this K<F, A> fa, Func<Error, K<F, A>> Fail) Source #

where F : Fallible<F>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<M, A> CatchIO <M, A> ( this K<M, A> ma, Func<Error, K<IO, A>> Fail) Source #

where M : Fallible<M>, Monad<M>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param ma

Fallible structure

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <F, A> ( this K<F, A> fa, Func<Error, Error> Fail) Source #

where F : Fallible<F>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <F, A> ( this K<F, A> fa, Func<Error, A> Fail) Source #

where F : Fallible<F>, Applicative<F>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <F, A> (this K<F, A> fa, Fail<Error> fail) Source #

where F : Fallible<F>, Applicative<F>

Run the Fallible structure. If in a failed state, replace the failure value with fail.

Parameters

type A

Bound value type

param fa

Fallible structure

method K<F, A> Catch <F, A> (this K<F, A> fa, Error fail) Source #

where F : Fallible<F>, Applicative<F>

Run the Fallible structure. If in a failed state, replace the failure value with fail.

Parameters

type A

Bound value type

param fa

Fallible structure

method K<F, A> Catch <F, A> (this K<F, A> fa, Pure<A> value) Source #

where F : Fallible<F>, Applicative<F>

Run the Fallible structure. If in a failed state, replace the failure value with the success value and cancelling the failure.

Parameters

type A

Bound value type

param fa

Fallible structure

method K<F, A> Catch <F, A> (this K<F, A> fa, A value) Source #

where F : Fallible<F>, Applicative<F>

Run the Fallible structure. If in a failed state, replace the failure value with the success value and cancelling the failure.

Parameters

type A

Bound value type

param fa

Fallible structure

method K<F, A> Catch <F, A> (this K<F, A> fa, K<F, A> alternative) Source #

where F : Fallible<F>, Applicative<F>

Run the Fallible structure. If in a failed state, replace the failure value with the alternative computation, which may succeed or fail.

Parameters

type A

Bound value type

param fa

Fallible structure

class FallibleExtensionsE Source #

Extensions for higher-kinded structures that have a failure state E

Parameters

type F

Higher-kinded structure

type E

Failure type

Methods

method K<F, A> Catch <E, F, A> ( this K<F, A> fa, Func<E, bool> Predicate, Func<E, K<F, A>> Fail) Source #

where F : Fallible<E, F>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Predicate

Predicate to test any failure values

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<M, A> Catch <E, M, A> ( this K<M, A> ma, Func<E, bool> Predicate, Func<E, K<IO, A>> Fail) Source #

where M : Fallible<E, M>, Monad<M>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param ma

Fallible structure

param Predicate

Predicate to test any failure values

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <E, F, A> ( this K<F, A> fa, Func<E, bool> Predicate, Func<E, E> Fail) Source #

where F : Fallible<E, F>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Predicate

Predicate to test any failure values

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <E, F, A> ( this K<F, A> fa, Func<E, bool> Predicate, Func<E, A> Fail) Source #

where F : Fallible<E, F>, Applicative<F>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Predicate

Predicate to test any failure values

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <E, F, A> ( this K<F, A> fa, CatchM<E, F, A> @catch) Source #

where F : Fallible<E, F>

Run the Fallible structure. If in a failed state, test the failure value against the catch structure and run its action if a match.

Parameters

type A

Bound value type

param fa

Fallible structure

param @catch

Catch structure created by the @catch functions. Contains the match predicate and action

returns

Either fa or the result of running the catch structure's action if fa is in a failed state and the

method K<M, A> Catch <E, M, A> ( this K<M, A> ma, E Match, Func<E, K<IO, A>> Fail) Source #

where M : Fallible<E, M>, Monad<M>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param ma

Fallible structure

param Match

Error to match to

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <E, F, A> ( this K<F, A> fa, E Match, Func<E, E> Fail) Source #

where F : Fallible<E, F>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Match

Error to match to

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <E, F, A> ( this K<F, A> fa, E Match, Func<E, A> Fail) Source #

where F : Fallible<E, F>, Applicative<F>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Match

Error to match to

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <E, F, A> ( this K<F, A> fa, Func<E, K<F, A>> Fail) Source #

where F : Fallible<E, F>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<M, A> Catch <E, M, A> ( this K<M, A> ma, Func<E, K<IO, A>> Fail) Source #

where M : Fallible<E, M>, Monad<M>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param ma

Fallible structure

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <E, F, A> ( this K<F, A> fa, Func<E, E> Fail) Source #

where F : Fallible<E, F>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <E, F, A> ( this K<F, A> fa, Func<E, A> Fail) Source #

where F : Fallible<E, F>, Applicative<F>

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

method K<F, A> Catch <E, F, A> (this K<F, A> fa, Fail<E> fail) Source #

where F : Fallible<E, F>, Applicative<F>

Run the Fallible structure. If in a failed state, replace the failure value with fail.

Parameters

type A

Bound value type

param fa

Fallible structure

method K<F, A> Catch <E, F, A> (this K<F, A> fa, E fail) Source #

where F : Fallible<E, F>, Applicative<F>

Run the Fallible structure. If in a failed state, replace the failure value with fail.

Parameters

type A

Bound value type

param fa

Fallible structure

method K<F, A> Catch <E, F, A> (this K<F, A> fa, Pure<A> value) Source #

where F : Fallible<E, F>, Applicative<F>

Run the Fallible structure. If in a failed state, replace the failure value with the success value and cancelling the failure.

Parameters

type A

Bound value type

param fa

Fallible structure

method K<F, A> Catch <E, F, A> (this K<F, A> fa, A value) Source #

where F : Fallible<E, F>, Applicative<F>

Run the Fallible structure. If in a failed state, replace the failure value with the success value and cancelling the failure.

Parameters

type A

Bound value type

param fa

Fallible structure

method K<F, A> Catch <E, F, A> (this K<F, A> fa, K<F, A> alternative) Source #

where F : Fallible<E, F>, Applicative<F>

Run the Fallible structure. If in a failed state, replace the failure value with the alternative computation, which may succeed or fail.

Parameters

type A

Bound value type

param fa

Fallible structure

class FallibleExtensions Source #

Methods

method K<M, Seq<Error>> Fails <F, M, A> ( this K<F, K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>
where F : Foldable<F>

Partitions a foldable of effects into successes and failures, and returns only the failures.

Parameters

type F

Foldable type

type M

Fallible monadic type

type A

Bound value type

param fma

Foldable of fallible monadic values

returns

A collection of Error values

method K<M, Seq<Error>> Fails <M, A> ( this Seq<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<Error>> Fails <M, A> ( this Iterable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<Error>> Fails <M, A> ( this Lst<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<Error>> Fails <M, A> ( this IEnumerable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<Error>> Fails <M, A> ( this HashSet<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<Error>> Fails <M, A> ( this Set<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

class FallibleExtensionsE Source #

Methods

method K<M, Seq<E>> Fails <E, F, M, A> ( this K<F, K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>
where F : Foldable<F>

Partitions a foldable of effects into successes and failures, and returns only the failures.

Parameters

type F

Foldable type

type M

Fallible monadic type

type A

Bound value type

param fma

Foldable of fallible monadic values

returns

A collection of E values

method K<M, Seq<E>> Fails <E, M, A> ( this Seq<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of E values

method K<M, Seq<E>> Fails <E, M, A> ( this Iterable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of E values

method K<M, Seq<E>> Fails <E, M, A> ( this Lst<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of E values

method K<M, Seq<E>> Fails <E, M, A> ( this IEnumerable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of E values

method K<M, Seq<E>> Fails <E, M, A> ( this HashSet<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of E values

method K<M, Seq<E>> Fails <E, M, A> ( this Set<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of E values

class FallibleExtensions Source #

Methods

method K<M, (Seq<Error> Fails, Seq<A> Succs)> Partition <F, M, A> ( this K<F, K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>
where F : Foldable<F>

Partitions a foldable of effects into two lists. 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 F

Foldable type

type M

Fallible monadic type

type A

Bound value type

param fma

Foldable of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<Error> Fails, Seq<A> Succs)> Partition <M, A> ( this Seq<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into two lists. 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 M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<Error> Fails, Seq<A> Succs)> Partition <M, A> ( this Iterable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into two lists. 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 M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<Error> Fails, Seq<A> Succs)> Partition <M, A> ( this Lst<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into two lists. 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 M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<Error> Fails, Seq<A> Succs)> Partition <M, A> ( this IEnumerable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into two lists. 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 M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<Error> Fails, Seq<A> Succs)> Partition <M, A> ( this HashSet<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into two lists. 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 M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<Error> Fails, Seq<A> Succs)> Partition <M, A> ( this Set<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into two lists. 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 M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

class FallibleExtensionsE Source #

Methods

method K<M, (Seq<E> Fails, Seq<A> Succs)> Partition <E, F, M, A> ( this K<F, K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>
where F : Foldable<F>

Partitions a foldable of effects into two lists. 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 E

Error type

type F

Foldable type

type M

Fallible monadic type

type A

Bound value type

param fma

Foldable of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<E> Fails, Seq<A> Succs)> Partition <E, M, A> ( this Seq<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into two lists. 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 E

Error type

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<E> Fails, Seq<A> Succs)> Partition <E, M, A> ( this Iterable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into two lists. 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 E

Error type

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<E> Fails, Seq<A> Succs)> Partition <E, M, A> ( this Lst<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into two lists. 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 E

Error type

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<E> Fails, Seq<A> Succs)> Partition <E, M, A> ( this IEnumerable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into two lists. 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 E

Error type

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<E> Fails, Seq<A> Succs)> Partition <E, M, A> ( this HashSet<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into two lists. 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 E

Error type

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<E> Fails, Seq<A> Succs)> Partition <E, M, A> ( this Set<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into two lists. 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 E

Error type

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

class FallibleExtensions Source #

Methods

method K<M, Seq<A>> Succs <F, M, A> ( this K<F, K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>
where F : Foldable<F>

Partitions a foldable of effects into successes and failures, and returns only the failures.

Parameters

type F

Foldable type

type M

Fallible monadic type

type A

Bound value type

param fma

Foldable of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> Succs <M, A> ( this Seq<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> Succs <M, A> ( this Iterable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> Succs <M, A> ( this Lst<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> Succs <M, A> ( this IEnumerable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> Succs <M, A> ( this HashSet<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> Succs <M, A> ( this Set<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

class FallibleExtensionsE Source #

Methods

method K<M, Seq<A>> Succs <E, F, M, A> ( this K<F, K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>
where F : Foldable<F>

Partitions a foldable of effects into successes and failures, and returns only the failures.

Parameters

type F

Foldable type

type M

Fallible monadic type

type A

Bound value type

param fma

Foldable of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> Succs <E, M, A> ( this Seq<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> Succs <E, M, A> ( this Iterable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> Succs <E, M, A> ( this Lst<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> Succs <E, M, A> ( this IEnumerable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> Succs <E, M, A> ( this HashSet<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> Succs <E, M, A> ( this Set<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

interface Fallible <FA, F, E, A> Source #

where FA : Fallible<FA, F, E, A>
where F : Fallible<E, F>, Applicative<F>

Derive your concrete types from this interface to acquire to common set of operators that will make working with the generic Fallible trait more elegant.

It isn't a requirement to implement this interface for Fallible to work, but it guides the implementor. It is optional!

Primarily makes @catch work nicely, but is generally benefical.

Parameters

type FA

'Self' type, for example Either<L, R>

type F

Trait implementation, for example Either<L>

type E

Failure type, for example L

type A

Bound value type, for example R

Operators

operator | (FA lhs, FA rhs) Source #

operator | (K<F, A> lhs, FA rhs) Source #

operator | (FA lhs, K<F, A> rhs) Source #

operator | (FA lhs, Pure<A> rhs) Source #

operator | (FA lhs, Fail<E> rhs) Source #

operator | (FA lhs, CatchM<E, F, A> rhs) Source #

class Fallible Source #

Module for higher-kinded structures that have a failure state E

Parameters

type F

Higher-kinded structure

type E

Failure type

Methods

method K<F, A> fail <E, F, A> (E error) Source #

where F : Fallible<E, F>

Raise a failure state in the Fallible structure F

Parameters

type F

Fallible trait

type E

Error type

type A

Bound value type

param error

Error to raise

returns

method K<F, A> error <F, A> (Error error) Source #

where F : Fallible<Error, F>

Raise a failure state in the Fallible structure F

Parameters

type F

Fallible trait

type A

Bound value type

param error

Error to raise

returns

method K<F, Unit> fail <E, F> (E error) Source #

where F : Fallible<E, F>

Raise a failure state in the Fallible structure F

Parameters

type F

Fallible trait

type E

Error type

type A

Bound value type

param error

Error to raise

returns

method K<F, Unit> error <F> (Error error) Source #

where F : Fallible<Error, F>

Raise a failure state in the Fallible structure F

Parameters

type F

Fallible trait

type E

Error type

type A

Bound value type

param error

Error to raise

returns

class Prelude Source #

The @catch functions produce a CatchError or CatchValue type. These can be composed together with the Aff and Eff monads (and maybe more in the future), to create a functional-programming equivalent to exception catching and matching.

Examples

 public class TimeoutExample<RT>
     where RT : struct,
     HasTime<RT>,
     HasCancel<RT>,
     HasConsole<RT>
 {
     public static Eff<RT, Unit> main =>
         from _1 in timeout(60 * seconds, longRunning)
                  | @catch(Errors.TimedOut, unitEff)
         from _2 in Console<RT>.writeLine("done")
         select unit;

     static Aff<RT, Unit> longRunning =>
         (from tm in Time<RT>.now
          from _1 in Console<RT>.writeLine(tm.ToLongTimeString())
          select unit)
        .ToAff()
        .Repeat(Schedule.Fibonacci(1 * second));
 }

Methods

method CatchM<Error, M, A> catchOf <E, M, A> (Func<E, K<M, A>> Fail) Source #

where E : Error
where M : Fallible<Error, M>, Monad<M>

Catch all Error errors of subtype E and return Fail

method CatchM<Error, M, A> catchOfFold <E, M, A> (Func<E, K<M, A>> Fail) Source #

where E : Error
where M : Fallible<Error, M>, MonoidK<M>

Catch all Error errors of subtype E and return Fail

method CatchM<Error, M, A> @catch <M, A> (Error error, Func<Error, K<M, A>> Fail) Source #

where M : Fallible<Error, M>

Catch an error if the error matches the argument provided

method CatchM<Error, M, A> @catch <M, A> (Error error, K<M, A> Fail) Source #

where M : Fallible<Error, M>

Catch an error if the error matches the argument provided

method CatchM<Error, M, A> @catch <M, A> (int errorCode, Func<Error, K<M, A>> Fail) Source #

where M : Fallible<Error, M>

Catch an error if the error matches the argument provided

method CatchM<Error, M, A> @catch <M, A> (int errorCode, K<M, A> Fail) Source #

where M : Fallible<Error, M>

Catch an error if the error matches the argument provided

method CatchM<Error, M, A> @catch <M, A> (Func<Error, bool> predicate, Func<Error, K<M, A>> Fail) Source #

where M : Fallible<Error, M>

Catch an error if the error matches the argument provided

method CatchM<Error, M, A> @catch <M, A> (Func<Error, bool> predicate, K<M, A> Fail) Source #

where M : Fallible<Error, M>

Catch an error if the error matches the argument provided

method CatchM<Error, M, A> @catch <M, A> (Func<Error, K<M, A>> Fail) Source #

where M : Fallible<Error, M>

Catch all errors and return Fail

method CatchM<Error, M, A> @catch <M, A> (K<M, A> Fail) Source #

where M : Fallible<Error, M>

Catch all errors and return Fail

method CatchM<Error, M, A> expected <M, A> (Func<Expected, K<M, A>> Fail) Source #

where M : Fallible<Error, M>, Monad<M>

Catch all Expected errors and return Fail

method CatchM<Error, M, A> expectedOf <E, M, A> (Func<E, K<M, A>> Fail) Source #

where E : Expected
where M : Fallible<Error, M>, Monad<M>

Catch all Expected errors of subtype E and return Fail

method CatchM<Error, M, A> exceptional <M, A> (Func<Exceptional, K<M, A>> Fail) Source #

where M : Fallible<Error, M>, Monad<M>

Catch all Exceptional errors and return Fail

method CatchM<Error, M, A> exceptionalOf <E, M, A> (Func<E, K<M, A>> Fail) Source #

where E : Exceptional
where M : Fallible<Error, M>, Monad<M>

Catch all errors and return Fail

method CatchM<Error, M, A> expectedFold <M, A> (Func<Expected, K<M, A>> Fail) Source #

where M : Fallible<Error, M>, MonoidK<M>

Catch all Expected errors and return Fail

method CatchM<Error, M, A> expectedOfFold <E, M, A> (Func<E, K<M, A>> Fail) Source #

where E : Expected
where M : Fallible<Error, M>, MonoidK<M>

Catch all Expected errors of subtype E and return Fail

method CatchM<Error, M, A> exceptionalFold <M, A> (Func<Exceptional, K<M, A>> Fail) Source #

where M : Fallible<Error, M>, MonoidK<M>

Catch all Exceptional errors and return Fail

method CatchM<Error, M, A> exceptionalOfFold <E, M, A> (Func<E, K<M, A>> Fail) Source #

where E : Exceptional
where M : Fallible<Error, M>, MonoidK<M>

Catch all errors and return Fail

class Prelude Source #

The @catch functions produce a CatchError or CatchValue type. These can be composed together with the Aff and Eff monads (and maybe more in the future), to create a functional-programming equivalent to exception catching and matching.

Examples

 public class TimeoutExample<RT>
     where RT : struct,
     HasTime<RT>,
     HasCancel<RT>,
     HasConsole<RT>
 {
     public static Eff<RT, Unit> main =>
         from _1 in timeout(60 * seconds, longRunning)
                  | @catch(Errors.TimedOut, unitEff)
         from _2 in Console<RT>.writeLine("done")
         select unit;

     static Aff<RT, Unit> longRunning =>
         (from tm in Time<RT>.now
          from _1 in Console<RT>.writeLine(tm.ToLongTimeString())
          select unit)
        .ToAff()
        .Repeat(Schedule.Fibonacci(1 * second));
 }

Methods

method CatchM<E, M, A> @catch <E, M, A> (E error, Func<E, K<M, A>> Fail) Source #

where M : Fallible<E, M>

Catch an error if the error matches the argument provided

method CatchM<E, M, A> @catch <E, M, A> (E error, K<M, A> Fail) Source #

where M : Fallible<E, M>

Catch an error if the error matches the argument provided

method CatchM<E, M, A> @catch <E, M, A> (Func<E, bool> predicate, Func<E, K<M, A>> Fail) Source #

where M : Fallible<E, M>

Catch an error if the error matches the argument provided

method CatchM<E, M, A> @catch <E, M, A> (Func<E, bool> predicate, K<M, A> Fail) Source #

where M : Fallible<E, M>

Catch an error if the error matches the argument provided

method CatchM<E, M, A> @catch <E, M, A> (Func<E, K<M, A>> Fail) Source #

where M : Fallible<E, M>

Catch all errors and return Fail

class Prelude Source #

Module for higher-kinded structures that have a failure state E

Parameters

type F

Higher-kinded structure

type E

Failure type

Methods

method K<F, A> fail <E, F, A> (E error) Source #

where F : Fallible<E, F>

Raise a failure state in the Fallible structure F

Parameters

type F

Fallible trait

type E

Error type

type A

Bound value type

param error

Error to raise

returns

method K<F, A> error <F, A> (Error error) Source #

where F : Fallible<Error, F>

Raise a failure state in the Fallible structure F

Parameters

type F

Fallible trait

type A

Bound value type

param error

Error to raise

returns

method K<F, Unit> fail <E, F> (E error) Source #

where F : Fallible<E, F>

Raise a failure state in the Fallible structure F

Parameters

type F

Fallible trait

type E

Error type

type A

Bound value type

param error

Error to raise

returns

method K<F, Unit> error <F> (Error error) Source #

where F : Fallible<Error, F>

Raise a failure state in the Fallible structure F

Parameters

type F

Fallible trait

type E

Error type

type A

Bound value type

param error

Error to raise

returns

class Prelude Source #

Methods

method K<M, Seq<Error>> fails <F, M, A> ( K<F, K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>
where F : Foldable<F>

Partitions a foldable of effects into successes and failures, and returns only the failures.

Parameters

type F

Foldable type

type M

Fallible monadic type

type A

Bound value type

param fma

Foldable of fallible monadic values

returns

A collection of Error values

method K<M, Seq<Error>> fails <M, A> ( Seq<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<Error>> fails <M, A> ( Iterable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<Error>> fails <M, A> ( Lst<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<Error>> fails <M, A> ( IEnumerable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<Error>> fails <M, A> ( HashSet<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<Error>> fails <M, A> ( Set<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

class FallibleExtensions Source #

Methods

method K<M, Seq<E>> fails <E, F, M, A> ( K<F, K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>
where F : Foldable<F>

Partitions a foldable of effects into successes and failures, and returns only the failures.

Parameters

type F

Foldable type

type M

Fallible monadic type

type A

Bound value type

param fma

Foldable of fallible monadic values

returns

A collection of E values

method K<M, Seq<E>> fails <E, M, A> ( Seq<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of E values

method K<M, Seq<E>> fails <E, M, A> ( Iterable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of E values

method K<M, Seq<E>> fails <E, M, A> ( Lst<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of E values

method K<M, Seq<E>> fails <E, M, A> ( IEnumerable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of E values

method K<M, Seq<E>> fails <E, M, A> ( HashSet<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of E values

method K<M, Seq<E>> fails <E, M, A> ( Set<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of E values

class Prelude Source #

Methods

method K<M, (Seq<Error> Fails, Seq<A> Succs)> partition <F, M, A> ( K<F, K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>
where F : Foldable<F>

Partitions a foldable of effects into two lists. 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 F

Foldable type

type M

Fallible monadic type

type A

Bound value type

param fma

Foldable of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<Error> Fails, Seq<A> Succs)> partition <M, A> ( Seq<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into two lists. 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 M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<Error> Fails, Seq<A> Succs)> partition <M, A> ( Iterable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into two lists. 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 M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<Error> Fails, Seq<A> Succs)> partition <M, A> ( Lst<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into two lists. 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 M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<Error> Fails, Seq<A> Succs)> partition <M, A> ( IEnumerable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into two lists. 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 M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<Error> Fails, Seq<A> Succs)> partition <M, A> ( HashSet<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into two lists. 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 M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<Error> Fails, Seq<A> Succs)> partition <M, A> ( Set<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into two lists. 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 M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

class Prelude Source #

Methods

method K<M, (Seq<E> Fails, Seq<A> Succs)> partition <E, F, M, A> ( K<F, K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>
where F : Foldable<F>

Partitions a foldable of effects into two lists. 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 E

Error type

type F

Foldable type

type M

Fallible monadic type

type A

Bound value type

param fma

Foldable of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<E> Fails, Seq<A> Succs)> partition <E, M, A> ( Seq<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into two lists. 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 E

Error type

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<E> Fails, Seq<A> Succs)> partition <E, M, A> ( Iterable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into two lists. 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 E

Error type

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<E> Fails, Seq<A> Succs)> partition <E, M, A> ( Lst<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into two lists. 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 E

Error type

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<E> Fails, Seq<A> Succs)> partition <E, M, A> ( IEnumerable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into two lists. 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 E

Error type

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<E> Fails, Seq<A> Succs)> partition <E, M, A> ( HashSet<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into two lists. 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 E

Error type

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

method K<M, (Seq<E> Fails, Seq<A> Succs)> partition <E, M, A> ( Set<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into two lists. 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 E

Error type

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A tuple containing an Error sequence and a Succ sequence

class Prelude Source #

Methods

method K<M, Seq<A>> succs <F, M, A> ( K<F, K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>
where F : Foldable<F>

Partitions a foldable of effects into successes and failures, and returns only the failures.

Parameters

type F

Foldable type

type M

Fallible monadic type

type A

Bound value type

param fma

Foldable of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> succs <M, A> ( Seq<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> succs <M, A> ( Iterable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> succs <M, A> ( Lst<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> succs <M, A> ( IEnumerable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> succs <M, A> ( HashSet<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> succs <M, A> ( Set<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

class FallibleExtensionsE Source #

Methods

method K<M, Seq<A>> succs <E, F, M, A> ( K<F, K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>
where F : Foldable<F>

Partitions a foldable of effects into successes and failures, and returns only the failures.

Parameters

type F

Foldable type

type M

Fallible monadic type

type A

Bound value type

param fma

Foldable of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> succs <E, M, A> ( Seq<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> succs <E, M, A> ( Iterable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> succs <E, M, A> ( Lst<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> succs <E, M, A> ( IEnumerable<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> succs <E, M, A> ( HashSet<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

method K<M, Seq<A>> succs <E, M, A> ( Set<K<M, A>> fma) Source #

where M : Monad<M>, Fallible<E, M>

Partitions a collection of effects into successes and failures, and returns only the failures.

Parameters

type M

Fallible monadic type

type A

Bound value type

param fma

Collection of fallible monadic values

returns

A collection of Error values

interface Fallible <E, F> Source #

Trait for higher-kinded structures that have a failure state E

Parameters

type E

Failure type

type F

Higher-kinded structure

Methods

method K<F, A> Fail <A> (E error) Source #

Raise a failure state in the Fallible structure F

Parameters

type A

Bound value type

param error

Error value

returns

method K<F, A> Catch <A> ( K<F, A> fa, Func<E, bool> Predicate, Func<E, K<F, A>> Fail) Source #

Run the Fallible structure. If in a failed state, test the failure value against the predicate. If, it returns true, run the Fail function with the failure value.

Parameters

type A

Bound value type

param fa

Fallible structure

param Predicate

Predicate to test any failure values

param Fail

Handler when in failed state

returns

Either fa or the result of Fail if fa is in a failed state and the predicate returns true for the failure value

interface Fallible <F> Source #

Trait for higher-kinded structures that have a failure state E

Parameters

type F

Higher-kinded structure

type E

Failure type