- BiFoldable <F, A, B>
- BiFoldable <F, A>
- TypeClass
- biFold <FOLD, F, A, B, S> (F foldable, S state, Func<S, A, S> fa, Func<S, B, S> fb)
- biFoldBack <FOLD, F, A, B, S> (F foldable, S state, Func<S, A, S> fa, Func<S, B, S> fb)
- biIter <FOLD, F, A, B> (F foldable, Action<A> fa, Action<B> fb)
- toBiSeq <FOLD, F, A, B> (F foldable)
- collect <FOLD, F, A, B, C> (F foldable, Func<A, C> fa, Func<B, C> fb)
- contains <EQ, FOLD, F, A, B> (F foldable, A item)
- contains <EQ, FOLD, F, A, B> (F foldable, B item)
- biForAll <FOLD, F, A, B> (F foldable, Func<A, bool> preda, Func<B, bool> predb)
- biExists <FOLD, F, A, B> (F foldable, Func<A, bool> preda, Func<B, bool> predb)
interface BiFoldable <F, A, B> Source #
interface BiFoldable <F, A> Source #
method S biFold <FOLD, F, A, B, S> (F foldable, S state, Func<S, A, S> fa, Func<S, B, S> fb) 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 | fa | Folder function, applied for each item in foldable |
param | fb | Folder function, applied for each item in foldable |
returns | The aggregate state |
method S biFoldBack <FOLD, F, A, B, S> (F foldable, S state, Func<S, A, S> fa, Func<S, B, S> fb) 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 | fa | Folder function, applied for each item in foldable |
param | fb | Folder function, applied for each item in foldable |
returns | The aggregate state |
method Unit biIter <FOLD, F, A, B> (F foldable, Action<A> fa, Action<B> fb) Source #
Iterate the values in the foldable
type | A | Bound value type |
param | foldable | Foldable to perform the operation on |
method IEnumerable<Either<A, B>> toBiSeq <FOLD, F, A, B> (F foldable) Source #
Turn any foldable into a sequence
type | A | Sequence item type |
param | foldable | Foldable |
returns | Sequence of As |
method IEnumerable<C> collect <FOLD, F, A, B, C> (F foldable, Func<A, C> fa, Func<B, C> fb) 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 bool contains <EQ, FOLD, F, A, B> (F foldable, A item) Source #
Does the element occur in the structure?
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 bool contains <EQ, FOLD, F, A, B> (F foldable, B item) Source #
Does the element occur in the structure?
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 bool biForAll <FOLD, F, A, B> (F foldable, Func<A, bool> preda, Func<B, bool> predb) 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 bool biExists <FOLD, F, A, B> (F foldable, Func<A, bool> preda, Func<B, bool> predb) 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 |