- FoldableAsync <FA, A>
- FoldableAsync <Env, FA, A>
- TypeClass
- foldAsync <FOLD, F, A, S> (F fa, S state, Func<S, A, S> f)
- foldAsync <FOLD, F, A, S> (F fa, S state, Func<S, A, Task<S>> f)
- foldBackAsync <FOLD, F, A, S> (F fa, S state, Func<S, A, S> f)
- foldBackAsync <FOLD, F, A, S> (F fa, S state, Func<S, A, Task<S>> f)
- iterAsync <FOLD, F, A> (F fa, Action<A> action)
- iterAsync <FOLD, F, A> (F fa, Func<A, Task<Unit>> action)
- toSeqAsync <FOLD, F, A> (F fa)
- collectAsync <FOLD, F, A, B> (F self, Func<A, B> f)
- headAsync <FOLD, F, A> (F fa)
- headOrNoneAsync <FOLD, F, A> (F fa)
- headOrInvalidAsync <FOLD, F, FAIL, A> (F fa, FAIL fail)
- headOrLeftAsync <FOLD, F, L, A> (F fa, L left)
- lastAsync <FOLD, F, A> (F fa)
- lastOrNoneAsync <FOLD, F, A> (F fa)
- isEmptyAsync <FOLD, F, A> (F fa)
- countAsync <FOLD, F, A> (F fa)
- containsAsync <EQ, FOLD, F, A> (F fa, A item)
- sumAsync <NUM, FOLD, F, A> (F fa)
- productAsync <NUM, FOLD, F, A> (F fa)
- forallAsync <FOLD, F, A> (F fa, Func<A,bool> pred)
- forallAsync <FOLD, F, A> (F fa, Func<A, Task<bool>> pred)
- existsAsync <FOLD, F, A> (F fa, Func<A, bool> pred)
- existsAsync <FOLD, F, A> (F fa, Func<A, Task<bool>> pred)
interface FoldableAsync <FA, A> Source #
interface FoldableAsync <Env, FA, A> Source #
method Task<S> foldAsync <FOLD, F, A, S> (F fa, S state, Func<S, A, S> f) Source #
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.
type | S | Aggregate state type |
param | state | Initial state |
param | f | Folder function, applied for each item in fa |
returns | The aggregate state |
method Task<S> foldAsync <FOLD, F, A, S> (F fa, S state, Func<S, A, Task<S>> f) Source #
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.
type | S | Aggregate state type |
param | state | Initial state |
param | f | Folder function, applied for each item in fa |
returns | The aggregate state |
method Task<S> foldBackAsync <FOLD, F, A, S> (F fa, S state, Func<S, A, S> f) Source #
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.
type | S | Aggregate state type |
param | state | Initial state |
param | f | Folder function, applied for each item in fa |
returns | The aggregate state |
method Task<S> foldBackAsync <FOLD, F, A, S> (F fa, S state, Func<S, A, Task<S>> f) Source #
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.
type | S | Aggregate state type |
param | state | Initial state |
param | f | Folder function, applied for each item in fa |
returns | The aggregate state |
method Task<Unit> iterAsync <FOLD, F, A> (F fa, Action<A> action) Source #
Iterate the values in the foldable
type | A | Bound value type |
param | self | Foldable to perform the operation on |
method Task<Unit> iterAsync <FOLD, F, A> (F fa, Func<A, Task<Unit>> action) Source #
Iterate the values in the foldable
type | A | Bound value type |
param | self | Foldable to perform the operation on |
method Task<Seq<A>> toSeqAsync <FOLD, F, A> (F fa) Source #
Turn any foldable into a sequence
type | A | Sequence item type |
param | fa | Foldable |
returns | Sequence of As |
method Task<IEnumerable<B>> collectAsync <FOLD, F, A, B> (F self, Func<A, B> f) Source #
Convert the foldable to a sequence (IEnumerable) performing a map operation on each item in the structure
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<A> headAsync <FOLD, F, A> (F fa) Source #
Get the first item in a foldable structure
type | A | Sequence item type |
param | fa | Foldable |
returns | First A produced by the foldable |
method Task<Option<A>> headOrNoneAsync <FOLD, F, A> (F fa) Source #
Get the first item in a foldable structure
type | A | Sequence item type |
param | fa | Foldable |
returns | First A produced by the foldable (Or None if no items produced) |
method Task<Validation<FAIL, A>> headOrInvalidAsync <FOLD, F, FAIL, A> (F fa, FAIL fail) Source #
Get the first item in a foldable structure
type | A | Sequence item type |
param | fa | Foldable |
param | fail | Fail case |
returns | First A produced by the foldable (Or Fail if no items produced) |
method Task<Either<L, A>> headOrLeftAsync <FOLD, F, L, A> (F fa, L left) Source #
Get the first item in a foldable structure
type | A | Sequence item type |
param | fa | Foldable |
param | left | Left case |
returns | First A produced by the foldable (Or Left if no items produced) |
method Task<A> lastAsync <FOLD, F, A> (F fa) Source #
Get the last item in a foldable structure
type | A | Sequence item type |
param | fa | Foldable |
returns | Last A produced by the foldable |
method Task<Option<A>> lastOrNoneAsync <FOLD, F, A> (F fa) Source #
Get the last item in a foldable structure
type | A | Sequence item type |
param | fa | Foldable |
returns | Last A produced by the foldable (Or None if no items produced) |
method Task<bool> isEmptyAsync <FOLD, F, A> (F fa) Source #
Tests whether the foldable structure is empty
type | A | Foldable item type |
param | fa | Foldable |
returns | True if empty, False otherwise |
method Task<int> countAsync <FOLD, F, A> (F fa) Source #
Find the length of a foldable structure
type | A | Foldable item type |
param | fa | Foldable |
returns | True if empty, False otherwise |
method Task<bool> containsAsync <EQ, FOLD, F, A> (F fa, A item) Source #
Does the element occur in the structure?
type | EQ | Eq type-class |
type | A | Foldable item type |
param | fa | Foldable |
param | item | Item to test |
returns | True if item in the structure |
method Task<A> sumAsync <NUM, FOLD, F, A> (F fa) Source #
The 'sum' function computes the sum of the numbers of a structure.
type | A | Foldable item type |
returns | Sum of the numbers in the structure |
method Task<A> productAsync <NUM, FOLD, F, A> (F fa) Source #
The 'product' function computes the product of the numbers of a structure.
type | NUM | Foldable && NUM type |
type | A | Foldable item type |
returns | Product of the numbers in the structure |
method Task<bool> forallAsync <FOLD, F, A> (F fa, Func<A,bool> pred) Source #
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.
param | pred | Predicate to apply |
returns | True if the predicate holds for all values |
method Task<bool> forallAsync <FOLD, F, A> (F fa, Func<A, Task<bool>> pred) Source #
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.
param | pred | Predicate to apply |
returns | True if the predicate holds for all values |
method Task<bool> existsAsync <FOLD, F, A> (F fa, Func<A, bool> pred) Source #
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.
param | pred | Predicate to apply |
returns | True if the predicate holds for all values |
method Task<bool> existsAsync <FOLD, F, A> (F fa, Func<A, Task<bool>> pred) Source #
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.
param | pred | Predicate to apply |
returns | True if the predicate holds for all values |