Contents
- AlternativeExtensions
- Filter <M, A> (this K<M, A> ma, Func<A, bool> predicate)
- Where <M, A> (this K<M, A> ma, Func<A, bool> predicate)
- Choose <M, A, B> (this K<M, A> ma, Func<A, Option<B>> selector)
- OneOf <F, A> (this Seq<K<F, A>> ms)
- Some <F, A> (this K<F, A> v)
- Many <F, A> (this K<F, A> v)
- Alternative
- empty <F, A> ()
- combine <F, A> (K<F, A> ma, K<F, A> mb)
- oneOf <F, A> (params K<F, A>[] ms)
- oneOf <F, A> (Seq<K<F, A>> ms)
- some <F, A> (K<F, A> v)
- many <F, A> (K<F, A> v)
- guard <F> (bool flag)
- Alternative <F>
class AlternativeExtensions Source #
A monoid on applicative functors
Parameters
type | F | Applicative functor |
Methods
method K<M, A> Filter <M, A> (this K<M, A> ma, Func<A, bool> predicate) Source #
Results in Empty if the predicate results in false
method K<M, A> Where <M, A> (this K<M, A> ma, Func<A, bool> predicate) Source #
Results in Empty if the predicate results in false
method K<M, B> Choose <M, A, B> (this K<M, A> ma, Func<A, Option<B>> selector) Source #
Chooses whether an element of the structure should be propagated through and if so maps the resulting value at the same time.
method K<F, A> OneOf <F, A> (this Seq<K<F, A>> ms) Source #
Given a set of applicative functors, return the first one to succeed.
If none succeed, the last applicative functor will be returned.
method K<F, Seq<A>> Some <F, A> (this K<F, A> v) Source #
One or more...
Run the applicative functor repeatedly, collecting the results, until failure.
Will always succeed if at least one item has been yielded.
Parameters
param | v | Applicative functor |
returns | One or more values |
class Alternative Source #
A monoid on applicative functors
Parameters
type | F | Applicative functor |
Methods
method K<F, A> combine <F, A> (K<F, A> ma, K<F, A> mb) Source #
Associative binary operator
method K<F, A> oneOf <F, A> (params K<F, A>[] ms) Source #
Given a set of applicative functors, return the first one to succeed.
If none succeed, the last applicative functor will be returned.
method K<F, A> oneOf <F, A> (Seq<K<F, A>> ms) Source #
Given a set of applicative functors, return the first one to succeed.
If none succeed, the last applicative functor will be returned.
method K<F, Seq<A>> some <F, A> (K<F, A> v) Source #
One or more...
Run the applicative functor repeatedly, collecting the results, until failure.
Will always succeed if at least one item has been yielded.
Parameters
param | v | Applicative functor |
returns | One or more values |
interface Alternative <F> Source #
A monoid on applicative functors
Parameters
type | F | Applicative functor |