LanguageExt.Core

LanguageExt.Core Type Classes BiFoldableAsync

Contents

interface BiFoldableAsync <F, A, B> Source #

interface BiFoldableAsync <F, A> Source #

class TypeClass Source #

Methods

method Task<S> biFoldAsync <FOLD, F, A, B, S> (F foldable, S state, Func<S, A, S> fa, Func<S, B, S> fb) Source #

where FOLD : struct, BiFoldableAsync<F, A, B>

In the case of lists, 'Fold', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right.

Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.

Parameters

type S

Aggregate state type

param state

Initial state

param fa

Folder function, applied for each item in foldable

param fb

Folder function, applied for each item in foldable

returns

The aggregate state

method Task<S> biFoldAsync <FOLD, F, A, B, S> (F foldable, S state, Func<S, A, Task<S>> fa, Func<S, B, S> fb) Source #

where FOLD : struct, BiFoldableAsync<F, A, B>

In the case of lists, 'Fold', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right.

Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.

Parameters

type S

Aggregate state type

param state

Initial state

param fa

Folder function, applied for each item in foldable

param fb

Folder function, applied for each item in foldable

returns

The aggregate state

method Task<S> biFoldAsync <FOLD, F, A, B, S> (F foldable, S state, Func<S, A, S> fa, Func<S, B, Task<S>> fb) Source #

where FOLD : struct, BiFoldableAsync<F, A, B>

In the case of lists, 'Fold', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right.

Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.

Parameters

type S

Aggregate state type

param state

Initial state

param fa

Folder function, applied for each item in foldable

param fb

Folder function, applied for each item in foldable

returns

The aggregate state

method Task<S> biFoldAsync <FOLD, F, A, B, S> (F foldable, S state, Func<S, A, Task<S>> fa, Func<S, B, Task<S>> fb) Source #

where FOLD : struct, BiFoldableAsync<F, A, B>

In the case of lists, 'Fold', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right.

Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.

Parameters

type S

Aggregate state type

param state

Initial state

param fa

Folder function, applied for each item in foldable

param fb

Folder function, applied for each item in foldable

returns

The aggregate state

method Task<S> biFoldBackAsync <FOLD, F, A, B, S> (F foldable, S state, Func<S, A, S> fa, Func<S, B, S> fb) Source #

where FOLD : struct, BiFoldableAsync<F, A, B>

In the case of lists, 'FoldBack', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right.

Note that to produce the outermost application of the operator the entire input list must be traversed.

Parameters

type S

Aggregate state type

param state

Initial state

param fa

Folder function, applied for each item in foldable

param fb

Folder function, applied for each item in foldable

returns

The aggregate state

method Task<S> biFoldBackAsync <FOLD, F, A, B, S> (F foldable, S state, Func<S, A, Task<S>> fa, Func<S, B, S> fb) Source #

where FOLD : struct, BiFoldableAsync<F, A, B>

In the case of lists, 'FoldBack', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right.

Note that to produce the outermost application of the operator the entire input list must be traversed.

Parameters

type S

Aggregate state type

param state

Initial state

param fa

Folder function, applied for each item in foldable

param fb

Folder function, applied for each item in foldable

returns

The aggregate state

method Task<S> biFoldBackAsync <FOLD, F, A, B, S> (F foldable, S state, Func<S, A, S> fa, Func<S, B, Task<S>> fb) Source #

where FOLD : struct, BiFoldableAsync<F, A, B>

In the case of lists, 'FoldBack', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right.

Note that to produce the outermost application of the operator the entire input list must be traversed.

Parameters

type S

Aggregate state type

param state

Initial state

param fa

Folder function, applied for each item in foldable

param fb

Folder function, applied for each item in foldable

returns

The aggregate state

method Task<S> biFoldBackAsync <FOLD, F, A, B, S> (F foldable, S state, Func<S, A, Task<S>> fa, Func<S, B, Task<S>> fb) Source #

where FOLD : struct, BiFoldableAsync<F, A, B>

In the case of lists, 'FoldBack', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right.

Note that to produce the outermost application of the operator the entire input list must be traversed.

Parameters

type S

Aggregate state type

param state

Initial state

param fa

Folder function, applied for each item in foldable

param fb

Folder function, applied for each item in foldable

returns

The aggregate state

method Task<Unit> biIterAsync <FOLD, F, A, B> (F foldable, Action<A> fa, Action<B> fb) Source #

where FOLD : struct, BiFoldableAsync<F, A, B>

Iterate the values in the foldable

Parameters

type A

Bound value type

param foldable

Foldable to perform the operation on

method Task<IEnumerable<Either<A, B>>> toBiSeqAsync <FOLD, F, A, B> (F foldable) Source #

where FOLD : struct, BiFoldableAsync<F, A, B>

Turn any foldable into a sequence

Parameters

type A

Sequence item type

param foldable

Foldable

returns

Sequence of As

method Task<IEnumerable<C>> collectAsync <FOLD, F, A, B, C> (F foldable, Func<A, C> fa, Func<B, C> fb) Source #

where FOLD : struct, BiFoldableAsync<F, A, B>

Convert the foldable to a sequence (IEnumerable) performing a map operation on each item in the structure

Parameters

type A

Bound value type

param self

Foldable to performt the operation on

returns

Sequence of As that represent the value(s) in the structure

method Task<bool> containsAsync <EQ, FOLD, F, A, B> (F foldable, A item) Source #

where FOLD : struct, BiFoldableAsync<F, A, B>
where EQ : struct, Eq<A>

Does the element occur in the structure?

Parameters

type EQ

Eq type-class

type A

Foldable item type

param foldable

Foldable

param item

Item to test

returns

True if item in the structure

method Task<bool> containsAsync <EQ, FOLD, F, A, B> (F foldable, B item) Source #

where FOLD : struct, BiFoldableAsync<F, A, B>
where EQ : struct, Eq<B>

Does the element occur in the structure?

Parameters

type EQ

Eq type-class

type A

Foldable item type

param foldable

Foldable

param item

Item to test

returns

True if item in the structure

method Task<bool> biForAllAsync <FOLD, F, A, B> (F foldable, Func<A, bool> preda, Func<B, bool> predb) Source #

where FOLD : struct, BiFoldableAsync<F, A, B>

Runs a predicate against the bound value(s). If the predicate holds for all values then true is returned.

NOTE: An empty structure will return true.

Parameters

param pred

Predicate to apply

returns

True if the predicate holds for all values

method Task<bool> biExistsAsync <FOLD, F, A, B> (F foldable, Func<A, bool> preda, Func<B, bool> predb) Source #

where FOLD : struct, BiFoldableAsync<F, A, B>

Runs a predicate against the bound value(s). If the predicate returns true for any item then the operation immediately returns true. False is returned if no items in the structure match the predicate.

NOTE: An empty structure will return false.

Parameters

param pred

Predicate to apply

returns

True if the predicate holds for all values