Applicative Functors are a 'stepping stone' between functors and monads – they're probably less well-known but have some interesting properties of their own when it comes to lifted expression evaluation.
Two of the major uses in language-ext is to enable automatic parallel processing of effectful computations and to automatically collect multiple errors when validating. Those aren't the only usages – all the higher-kinded-types, including the collection-types, have applicative traits.
The topic is too large to cover here, so take a look at Paul Louth's Higher-Kinds series for more information.
- ApplicativeExtensions
- ApplyM <M, A, B> (this K<M, Func<A, K<M, B>>> mf, K<M, A> ma)
- Apply <AF, A, B> (this K<AF, Func<A, B>> mf, K<AF, A> ma)
- Apply <AF, A, B> (this K<AF, Func<A, B>> mf, Func<K<AF, A>> ma)
- Apply <AF, A, B, C> (this K<AF, Func<A, B, C>> mf, K<AF, A> ma)
- Apply <AF, A, B, C, D> (this K<AF, Func<A, B, C, D>> mf, K<AF, A> ma)
- Apply <AF, A, B, C, D, E> (this K<AF, Func<A, B, C, D, E>> mf, K<AF, A> ma)
- Apply <AF, A, B, C, D, E, F> (this K<AF, Func<A, B, C, D, E, F>> mf, K<AF, A> ma)
- Apply <AF, A, B, C, D, E, F, G> (this K<AF, Func<A, B, C, D, E, F, G>> mf, K<AF, A> ma)
- Apply <AF, A, B, C, D, E, F, G, H> (this K<AF, Func<A, B, C, D, E, F, G, H>> mf, K<AF, A> ma)
- Apply <AF, A, B, C, D, E, F, G, H, I> (this K<AF, Func<A, B, C, D, E, F, G, H, I>> mf, K<AF, A> ma)
- Apply <AF, A, B, C, D, E, F, G, H, I, J> (this K<AF, Func<A, B, C, D, E, F, G, H, I, J>> mf, K<AF, A> ma)
- Apply <AF, A, B, C, D, E, F, G, H, I, J, K> (this K<AF, Func<A, B, C, D, E, F, G, H, I, J, K>> mf, K<AF, A> ma)
- Action <F, A, B> (this K<F, A> ma, K<F, B> mb)
- Actions <F, A> (this IEnumerable<K<F, A>> ma)
- Actions <F, A> (this IAsyncEnumerable<K<F, A>> ma)
- Lift <F, A, B> (this Func<A, B> f, K<F, A> fa)
- Lift <F, A, B, C> (this Func<A, B, C> f, K<F, A> fa, K<F, B> fb)
- Lift <F, A, B, C> (this Func<A, Func<B, C>> f, K<F, A> fa, K<F, B> fb)
- Lift <F, A, B, C, D> (this Func<A, B, C, D> f, K<F, A> fa, K<F, B> fb, K<F, C> fc)
- Lift <F, A, B, C, D> (this Func<A, Func<B, Func<C, D>>> f, K<F, A> fa, K<F, B> fb, K<F, C> fc)
- Apply <Fnctr, A, B, R> ( this (K<Fnctr, A>, K<Fnctr, B>) items, Func<A, B, R> f)
- ApplyM <M, A, B, R> ( this (K<M, A>, K<M, B>) items, Func<A, B, K<M, R>> f)
- Apply <Fnctr, A, B, C, R> ( this (K<Fnctr, A>, K<Fnctr, B>, K<Fnctr, C>) items, Func<A, B, C, R> f)
- ApplyM <M, A, B, C, R> ( this (K<M, A>, K<M, B>, K<M, C>) items, Func<A, B, C, K<M, R>> f)
- Apply <Fnctr, A, B, C, D, R> ( this (K<Fnctr, A>, K<Fnctr, B>, K<Fnctr, C>, K<Fnctr, D>) items, Func<A, B, C, D, R> f)
- ApplyM <M, A, B, C, D, R> ( this (K<M, A>, K<M, B>, K<M, C>, K<M, D>) items, Func<A, B, C, D, K<M, R>> f)
- Apply <Fnctr, A, B, C, D, E, R> ( this (K<Fnctr, A>, K<Fnctr, B>, K<Fnctr, C>, K<Fnctr, D>, K<Fnctr, E>) items, Func<A, B, C, D, E, R> f)
- ApplyM <M, A, B, C, D, E, R> ( this (K<M, A>, K<M, B>, K<M, C>, K<M, D>, K<M, E>) items, Func<A, B, C, D, E, K<M, R>> f)
- Apply <Fnctr, A, B, C, D, E, F, R> ( this (K<Fnctr, A>, K<Fnctr, B>, K<Fnctr, C>, K<Fnctr, D>, K<Fnctr, E>, K<Fnctr, F>) items, Func<A, B, C, D, E, F, R> f)
- ApplyM <M, A, B, C, D, E, F, R> ( this (K<M, A>, K<M, B>, K<M, C>, K<M, D>, K<M, E>, K<M, F>) items, Func<A, B, C, D, E, F, K<M, R>> f)
- Apply <Fnctr, A, B, C, D, E, F, G, R> ( this (K<Fnctr, A>, K<Fnctr, B>, K<Fnctr, C>, K<Fnctr, D>, K<Fnctr, E>, K<Fnctr, F>, K<Fnctr, G>) items, Func<A, B, C, D, E, F, G, R> f)
- ApplyM <M, A, B, C, D, E, F, G, R> ( this (K<M, A>, K<M, B>, K<M, C>, K<M, D>, K<M, E>, K<M, F>, K<M, G>) items, Func<A, B, C, D, E, F, G, K<M, R>> f)
- Apply <Fnctr, A, B, C, D, E, F, G, H, R> ( this (K<Fnctr, A>, K<Fnctr, B>, K<Fnctr, C>, K<Fnctr, D>, K<Fnctr, E>, K<Fnctr, F>, K<Fnctr, G>, K<Fnctr, H>) items, Func<A, B, C, D, E, F, G, H, R> f)
- ApplyM <M, A, B, C, D, E, F, G, H, R> ( this (K<M, A>, K<M, B>, K<M, C>, K<M, D>, K<M, E>, K<M, F>, K<M, G>, K<M, H>) items, Func<A, B, C, D, E, F, G, H, K<M, R>> f)
- Apply <Fnctr, A, B, C, D, E, F, G, H, I, R> ( this (K<Fnctr, A>, K<Fnctr, B>, K<Fnctr, C>, K<Fnctr, D>, K<Fnctr, E>, K<Fnctr, F>, K<Fnctr, G>, K<Fnctr, H>, K<Fnctr, I>) items, Func<A, B, C, D, E, F, G, H, I, R> f)
- ApplyM <M, A, B, C, D, E, F, G, H, I, R> ( this (K<M, A>, K<M, B>, K<M, C>, K<M, D>, K<M, E>, K<M, F>, K<M, G>, K<M, H>, K<M, I>) items, Func<A, B, C, D, E, F, G, H, I, K<M, R>> f)
- Apply <Fnctr, A, B, C, D, E, F, G, H, I, J, R> ( this (K<Fnctr, A>, K<Fnctr, B>, K<Fnctr, C>, K<Fnctr, D>, K<Fnctr, E>, K<Fnctr, F>, K<Fnctr, G>, K<Fnctr, H>, K<Fnctr, I>, K<Fnctr, J>) items, Func<A, B, C, D, E, F, G, H, I, J, R> f)
- ApplyM <M, A, B, C, D, E, F, G, H, I, J, R> ( this (K<M, A>, K<M, B>, K<M, C>, K<M, D>, K<M, E>, K<M, F>, K<M, G>, K<M, H>, K<M, I>, K<M, J>) items, Func<A, B, C, D, E, F, G, H, I, J, K<M, R>> f)
- Add <NumA, F, A> (this K<F, A> fa, K<F, A> fb)
- Add <F, A> (this K<F, A> fa, K<F, A> fb)
- Subtract <NumA, F, A> (this K<F, A> fa, K<F, A> fb)
- Subtract <F, A> (this K<F, A> fa, K<F, A> fb)
- Multiply <NumA, F, A> (this K<F, A> fa, K<F, A> fb)
- Multiply <F, A> (this K<F, A> fa, K<F, A> fb)
- Divide <NumA, F, A> (this K<F, A> fa, K<F, A> fb)
- Divide <F, A> (this K<F, A> fa, K<F, A> fb)
- Zip <F, A, B> ( this (K<F, A> First, K<F, B> Second) tuple)
- Zip <F, A, B, C> ( this (K<F, A> First, K<F, B> Second, K<F, C> Third) tuple)
- Zip <F, A, B, C, D> ( this (K<F, A> First, K<F, B> Second, K<F, C> Third, K<F, D> Fourth) tuple)
- Zip <F, A, B, C, D, E> ( this (K<F, A> First, K<F, B> Second, K<F, C> Third, K<F, D> Fourth, K<F, E> Fifth) tuple)
- Zip <F, A, B> ( this K<F, A> First, K<F, B> Second)
- Zip <F, A, B, C> ( this K<F, A> First, K<F, B> Second, K<F, C> Third)
- Zip <F, A, B, C, D> ( this K<F, A> First, K<F, B> Second, K<F, C> Third, K<F, D> Fourth)
- Zip <F, A, B, C, D, E> ( this K<F, A> First, K<F, B> Second, K<F, C> Third, K<F, D> Fourth, K<F, E> Fifth)
- ApplicativeLaw <F>
- assert (Func<K<F, int>, K<F, int>, bool>? equals = null)
- validate (Func<K<F, int>, K<F, int>, bool>? equals = null)
- homomorphismLaw (Func<K<F, int>, K<F, int>, bool> equals)
- interchangeLaw (Func<K<F, int>, K<F, int>, bool> equals)
- identityLaw (Func<K<F, int>, K<F, int>, bool> equals)
- compositionLaw (Func<K<F, int>, K<F, int>, bool> equals)
- functorLaw (Func<K<F, int>, K<F, int>, bool> equals)
- Applicative
- pure <F, A> (A value)
- apply <F, A, B> (K<F, Func<A, B>> mf, K<F, A> ma)
- apply <F, A, B, C> (K<F, Func<A, B, C>> mf, K<F, A> ma)
- apply <F, A, B, C> (K<F, Func<A, B, C>> mf, K<F, A> ma, K<F, B> mb)
- apply <F, A, B, C, D> (K<F, Func<A, B, C, D>> mf, K<F, A> ma, K<F, B> mb, K<F, C> mc)
- apply <F, A, B, C, D> (K<F, Func<A, B, C, D>> mf, K<F, A> ma, K<F, B> mb)
- apply <F, A, B, C, D> (K<F, Func<A, B, C, D>> mf, K<F, A> ma)
- action <F, A, B> (K<F, A> ma, K<F, B> mb)
- actions <F, A> (IEnumerable<K<F, A>> ma)
- when <F> (bool flag, K<F, Unit> fx)
- unless <F> (bool flag, K<F, Unit> fx)
- lift <F, A, B> (Func<A, B> f, K<F, A> fa)
- lift <F, A, B, C> (Func<A, B, C> f, K<F, A> fa, K<F, B> fb)
- lift <F, A, B, C> (Func<A, Func<B, C>> f, K<F, A> fa, K<F, B> fb)
- lift <F, A, B, C, D> (Func<A, B, C, D> f, K<F, A> fa, K<F, B> fb, K<F, C> fc)
- lift <F, A, B, C, D> (Func<A, Func<B, Func<C, D>>> f, K<F, A> fa, K<F, B> fb, K<F, C> fc)
- Prelude
- pure <F, A> (A value)
- applyM <M, A, B> (K<M, Func<A, K<M, B>>> mf, K<M, A> ma)
- apply <AF, A, B> (K<AF, Func<A, B>> mf, K<AF, A> ma)
- apply <AF, A, B, C> (K<AF, Func<A, B, C>> mf, K<AF, A> ma)
- apply <AF, A, B, C, D> (K<AF, Func<A, B, C, D>> mf, K<AF, A> ma)
- apply <AF, A, B, C, D, E> (K<AF, Func<A, B, C, D, E>> mf, K<AF, A> ma)
- apply <AF, A, B, C, D, E, F> (K<AF, Func<A, B, C, D, E, F>> mf, K<AF, A> ma)
- apply <AF, A, B, C, D, E, F, G> (K<AF, Func<A, B, C, D, E, F, G>> mf, K<AF, A> ma)
- apply <AF, A, B, C, D, E, F, G, H> (K<AF, Func<A, B, C, D, E, F, G, H>> mf, K<AF, A> ma)
- apply <AF, A, B, C, D, E, F, G, H, I> (K<AF, Func<A, B, C, D, E, F, G, H, I>> mf, K<AF, A> ma)
- apply <AF, A, B, C, D, E, F, G, H, I, J> (K<AF, Func<A, B, C, D, E, F, G, H, I, J>> mf, K<AF, A> ma)
- apply <AF, A, B, C, D, E, F, G, H, I, J, K> (K<AF, Func<A, B, C, D, E, F, G, H, I, J, K>> mf, K<AF, A> ma)
- action <F, A, B> (K<F, A> ma, K<F, B> mb)
- actions <F, A> (IEnumerable<K<F, A>> ma)
- actions <F, A> (IAsyncEnumerable<K<F, A>> ma)
- zip <F, A, B> ( (K<F, A> First, K<F, B> Second) tuple)
- zip <F, A, B, C> ( (K<F, A> First, K<F, B> Second, K<F, C> Third) tuple)
- zip <F, A, B, C, D> ( (K<F, A> First, K<F, B> Second, K<F, C> Third, K<F, D> Fourth) tuple)
- zip <F, A, B, C, D, E> ( (K<F, A> First, K<F, B> Second, K<F, C> Third, K<F, D> Fourth, K<F, E> Fifth) tuple)
- zip <F, A, B> ( K<F, A> First, K<F, B> Second)
- zip <F, A, B, C> ( K<F, A> First, K<F, B> Second, K<F, C> Third)
- zip <F, A, B, C, D> ( K<F, A> First, K<F, B> Second, K<F, C> Third, K<F, D> Fourth)
- zip <F, A, B, C, D, E> ( K<F, A> First, K<F, B> Second, K<F, C> Third, K<F, D> Fourth, K<F, E> Fifth)
- Applicative <F>
- Pure <A> (A value)
- Apply <A, B> (K<F, Func<A, B>> mf, K<F, A> ma)
- ApplyLazy <A, B> (K<F, Func<A, B>> mf, Func<K<F, A>> ma)
- Action <A, B> (K<F, A> ma, K<F, B> mb)
- Apply <A, B, C> (K<F, Func<A, B, C>> mf, K<F, A> ma, K<F, B> mb)
- Apply <A, B, C> (K<F, Func<A, B, C>> mf, K<F, A> ma)
- Apply <A, B, C> (K<F, Func<A, Func<B, C>>> mf, K<F, A> ma, K<F, B> mb)
- Actions <A> (params K<F, A>[] fas)
- Actions <A> (Seq<K<F, A>> fas)
- Actions <A> (IEnumerable<K<F, A>> fas)
- Actions <A> (IAsyncEnumerable<K<F, A>> fas)
class ApplicativeExtensions Source #
Monad module
method K<M, B> ApplyM <M, A, B> (this K<M, Func<A, K<M, B>>> mf, K<M, A> ma) Source #
method K<AF, B> Apply <AF, A, B> (this K<AF, Func<A, B>> mf, K<AF, A> ma) Source #
method K<AF, B> Apply <AF, A, B> (this K<AF, Func<A, B>> mf, Func<K<AF, A>> ma) Source #
method K<AF, Func<B, C>> Apply <AF, A, B, C> (this K<AF, Func<A, B, C>> mf, K<AF, A> ma) Source #
method K<AF, Func<B,Func<C, D>>> Apply <AF, A, B, C, D> (this K<AF, Func<A, B, C, D>> mf, K<AF, A> ma) Source #
method K<AF, Func<B,Func<C, Func<D, E>>>> Apply <AF, A, B, C, D, E> (this K<AF, Func<A, B, C, D, E>> mf, K<AF, A> ma) Source #
method K<AF, Func<B,Func<C, Func<D, Func<E, F>>>>> Apply <AF, A, B, C, D, E, F> (this K<AF, Func<A, B, C, D, E, F>> mf, K<AF, A> ma) Source #
method K<AF, Func<B,Func<C, Func<D, Func<E, Func<F, G>>>>>> Apply <AF, A, B, C, D, E, F, G> (this K<AF, Func<A, B, C, D, E, F, G>> mf, K<AF, A> ma) Source #
method K<AF, Func<B,Func<C, Func<D, Func<E, Func<F, Func<G, H>>>>>>> Apply <AF, A, B, C, D, E, F, G, H> (this K<AF, Func<A, B, C, D, E, F, G, H>> mf, K<AF, A> ma) Source #
method K<AF, Func<B,Func<C, Func<D, Func<E, Func<F, Func<G, Func<H, I>>>>>>>> Apply <AF, A, B, C, D, E, F, G, H, I> (this K<AF, Func<A, B, C, D, E, F, G, H, I>> mf, K<AF, A> ma) Source #
method K<AF, Func<B,Func<C, Func<D, Func<E, Func<F, Func<G, Func<H, Func<I, J>>>>>>>>> Apply <AF, A, B, C, D, E, F, G, H, I, J> (this K<AF, Func<A, B, C, D, E, F, G, H, I, J>> mf, K<AF, A> ma) Source #
method K<AF, Func<B,Func<C, Func<D, Func<E, Func<F, Func<G, Func<H, Func<I, Func<J, K>>>>>>>>>> Apply <AF, A, B, C, D, E, F, G, H, I, J, K> (this K<AF, Func<A, B, C, D, E, F, G, H, I, J, K>> mf, K<AF, A> ma) Source #
method K<F, C> Lift <F, A, B, C> (this Func<A, B, C> f, K<F, A> fa, K<F, B> fb) Source #
method K<F, C> Lift <F, A, B, C> (this Func<A, Func<B, C>> f, K<F, A> fa, K<F, B> fb) Source #
method K<F, D> Lift <F, A, B, C, D> (this Func<A, B, C, D> f, K<F, A> fa, K<F, B> fb, K<F, C> fc) Source #
method K<F, D> Lift <F, A, B, C, D> (this Func<A, Func<B, Func<C, D>>> f, K<F, A> fa, K<F, B> fb, K<F, C> fc) Source #
method K<Fnctr, R> Apply <Fnctr, A, B, R> ( this (K<Fnctr, A>, K<Fnctr, B>) items, Func<A, B, R> f) Source #
method K<M, R> ApplyM <M, A, B, R> ( this (K<M, A>, K<M, B>) items, Func<A, B, K<M, R>> f) Source #
method K<Fnctr, R> Apply <Fnctr, A, B, C, R> ( this (K<Fnctr, A>, K<Fnctr, B>, K<Fnctr, C>) items, Func<A, B, C, R> f) Source #
method K<M, R> ApplyM <M, A, B, C, R> ( this (K<M, A>, K<M, B>, K<M, C>) items, Func<A, B, C, K<M, R>> f) Source #
method K<Fnctr, R> Apply <Fnctr, A, B, C, D, R> ( this (K<Fnctr, A>, K<Fnctr, B>, K<Fnctr, C>, K<Fnctr, D>) items, Func<A, B, C, D, R> f) Source #
method K<M, R> ApplyM <M, A, B, C, D, R> ( this (K<M, A>, K<M, B>, K<M, C>, K<M, D>) items, Func<A, B, C, D, K<M, R>> f) Source #
method K<Fnctr, R> Apply <Fnctr, A, B, C, D, E, R> ( this (K<Fnctr, A>, K<Fnctr, B>, K<Fnctr, C>, K<Fnctr, D>, K<Fnctr, E>) items, Func<A, B, C, D, E, R> f) Source #
method K<M, R> ApplyM <M, A, B, C, D, E, R> ( this (K<M, A>, K<M, B>, K<M, C>, K<M, D>, K<M, E>) items, Func<A, B, C, D, E, K<M, R>> f) Source #
method K<Fnctr, R> Apply <Fnctr, A, B, C, D, E, F, R> ( this (K<Fnctr, A>, K<Fnctr, B>, K<Fnctr, C>, K<Fnctr, D>, K<Fnctr, E>, K<Fnctr, F>) items, Func<A, B, C, D, E, F, R> f) Source #
method K<M, R> ApplyM <M, A, B, C, D, E, F, R> ( this (K<M, A>, K<M, B>, K<M, C>, K<M, D>, K<M, E>, K<M, F>) items, Func<A, B, C, D, E, F, K<M, R>> f) Source #
method K<Fnctr, R> Apply <Fnctr, A, B, C, D, E, F, G, R> ( this (K<Fnctr, A>, K<Fnctr, B>, K<Fnctr, C>, K<Fnctr, D>, K<Fnctr, E>, K<Fnctr, F>, K<Fnctr, G>) items, Func<A, B, C, D, E, F, G, R> f) Source #
method K<M, R> ApplyM <M, A, B, C, D, E, F, G, R> ( this (K<M, A>, K<M, B>, K<M, C>, K<M, D>, K<M, E>, K<M, F>, K<M, G>) items, Func<A, B, C, D, E, F, G, K<M, R>> f) Source #
method K<Fnctr, R> Apply <Fnctr, A, B, C, D, E, F, G, H, R> ( this (K<Fnctr, A>, K<Fnctr, B>, K<Fnctr, C>, K<Fnctr, D>, K<Fnctr, E>, K<Fnctr, F>, K<Fnctr, G>, K<Fnctr, H>) items, Func<A, B, C, D, E, F, G, H, R> f) Source #
method K<M, R> ApplyM <M, A, B, C, D, E, F, G, H, R> ( this (K<M, A>, K<M, B>, K<M, C>, K<M, D>, K<M, E>, K<M, F>, K<M, G>, K<M, H>) items, Func<A, B, C, D, E, F, G, H, K<M, R>> f) Source #
method K<Fnctr, R> Apply <Fnctr, A, B, C, D, E, F, G, H, I, R> ( this (K<Fnctr, A>, K<Fnctr, B>, K<Fnctr, C>, K<Fnctr, D>, K<Fnctr, E>, K<Fnctr, F>, K<Fnctr, G>, K<Fnctr, H>, K<Fnctr, I>) items, Func<A, B, C, D, E, F, G, H, I, R> f) Source #
method K<M, R> ApplyM <M, A, B, C, D, E, F, G, H, I, R> ( this (K<M, A>, K<M, B>, K<M, C>, K<M, D>, K<M, E>, K<M, F>, K<M, G>, K<M, H>, K<M, I>) items, Func<A, B, C, D, E, F, G, H, I, K<M, R>> f) Source #
method K<Fnctr, R> Apply <Fnctr, A, B, C, D, E, F, G, H, I, J, R> ( this (K<Fnctr, A>, K<Fnctr, B>, K<Fnctr, C>, K<Fnctr, D>, K<Fnctr, E>, K<Fnctr, F>, K<Fnctr, G>, K<Fnctr, H>, K<Fnctr, I>, K<Fnctr, J>) items, Func<A, B, C, D, E, F, G, H, I, J, R> f) Source #
method K<M, R> ApplyM <M, A, B, C, D, E, F, G, H, I, J, R> ( this (K<M, A>, K<M, B>, K<M, C>, K<M, D>, K<M, E>, K<M, F>, K<M, G>, K<M, H>, K<M, I>, K<M, J>) items, Func<A, B, C, D, E, F, G, H, I, J, K<M, R>> f) Source #
method K<F, A> Add <NumA, F, A> (this K<F, A> fa, K<F, A> fb) Source #
Sum the bound values of the applicative structures provided
type | NumA | Num of A |
type | A | Bound value type |
param | fx | Left hand side of the operation |
param | fy | Right hand side of the operation |
returns | An applicative structure with the arithmetic operation applied to the bound values. |
method K<F, A> Add <F, A> (this K<F, A> fa, K<F, A> fb) Source #
Sum the bound values of the applicative structures provided
type | NumA | Num of A |
type | A | Bound value type |
param | fx | Left hand side of the operation |
param | fy | Right hand side of the operation |
returns | An applicative structure with the arithmetic operation applied to the bound values. |
method K<F, A> Subtract <NumA, F, A> (this K<F, A> fa, K<F, A> fb) Source #
Subtract the bound values of the applicative structures provided
type | NumA | Num of A |
type | A | Bound value type |
param | fx | Left hand side of the operation |
param | fy | Right hand side of the operation |
returns | An applicative structure with the arithmetic operation applied to the bound values. |
method K<F, A> Subtract <F, A> (this K<F, A> fa, K<F, A> fb) Source #
Subtract the bound values of the applicative structures provided
type | NumA | Num of A |
type | A | Bound value type |
param | fx | Left hand side of the operation |
param | fy | Right hand side of the operation |
returns | An applicative structure with the arithmetic operation applied to the bound values. |
method K<F, A> Multiply <NumA, F, A> (this K<F, A> fa, K<F, A> fb) Source #
Multiply the bound values of the applicative structures provided
type | NumA | Num of A |
type | A | Bound value type |
param | fx | Left hand side of the operation |
param | fy | Right hand side of the operation |
returns | An applicative structure with the arithmetic operation applied to the bound values. |
method K<F, A> Multiply <F, A> (this K<F, A> fa, K<F, A> fb) Source #
Multiply the bound values of the applicative structures provided
type | NumA | Num of A |
type | A | Bound value type |
param | fx | Left hand side of the operation |
param | fy | Right hand side of the operation |
returns | An applicative structure with the arithmetic operation applied to the bound values. |
method K<F, A> Divide <NumA, F, A> (this K<F, A> fa, K<F, A> fb) Source #
Multiply the bound values of the applicative structures provided
type | NumA | Num of A |
type | A | Bound value type |
param | fx | Left hand side of the operation |
param | fy | Right hand side of the operation |
returns | An applicative structure with the arithmetic operation applied to the bound values. |
method K<F, A> Divide <F, A> (this K<F, A> fa, K<F, A> fb) Source #
Multiply the bound values of the applicative structures provided
type | NumA | Num of A |
type | A | Bound value type |
param | fx | Left hand side of the operation |
param | fy | Right hand side of the operation |
returns | An applicative structure with the arithmetic operation applied to the bound values. |
method K<F, (A First, B Second)> Zip <F, A, B> ( this (K<F, A> First, K<F, B> Second) tuple) Source #
Zips applicatives into a tuple
type | F | Applicative trait type |
type | A | First applicative's bound value type |
type | B | Second applicative's bound value type |
param | tuple | Tuple of applicatives to run |
returns | Zipped applicative |
method K<F, (A First, B Second, C Third)> Zip <F, A, B, C> ( this (K<F, A> First, K<F, B> Second, K<F, C> Third) tuple) Source #
Zips applicatives into a tuple
type | F | Applicative trait type |
type | A | First applicative's bound value type |
type | B | Second applicative's bound value type |
type | C | Third applicative's bound value type |
param | tuple | Tuple of applicatives to run |
returns | Zipped applicative |
method K<F, (A First, B Second, C Third, D Fourth)> Zip <F, A, B, C, D> ( this (K<F, A> First, K<F, B> Second, K<F, C> Third, K<F, D> Fourth) tuple) Source #
Zips applicatives into a tuple
type | F | Applicative trait type |
type | A | First applicative's bound value type |
type | B | Second applicative's bound value type |
type | C | Third applicative's bound value type |
type | D | Fourth applicative's bound value type |
param | tuple | Tuple of applicatives to run |
returns | Zipped applicative |
method K<F, (A First, B Second, C Third, D Fourth, E Fifth)> Zip <F, A, B, C, D, E> ( this (K<F, A> First, K<F, B> Second, K<F, C> Third, K<F, D> Fourth, K<F, E> Fifth) tuple) Source #
Zips applicatives into a tuple
type | F | Applicative trait type |
type | A | First applicative's bound value type |
type | B | Second applicative's bound value type |
type | C | Third applicative's bound value type |
type | D | Fourth applicative's bound value type |
param | tuple | Tuple of applicatives to run |
returns | Zipped applicative |
method K<F, (A First, B Second)> Zip <F, A, B> ( this K<F, A> First, K<F, B> Second) Source #
Zips applicatives into a tuple
type | F | Applicative trait type |
type | A | First applicative's bound value type |
type | B | Second applicative's bound value type |
param | First | First applicative |
param | Second | Second applicative |
returns | Zipped applicative |
method K<F, (A First, B Second, C Third)> Zip <F, A, B, C> ( this K<F, A> First, K<F, B> Second, K<F, C> Third) Source #
Zips applicatives into a tuple
type | F | Applicative trait type |
type | A | First applicative's bound value type |
type | B | Second applicative's bound value type |
type | C | Third applicative's bound value type |
param | First | First applicative |
param | Second | Second applicative |
param | Third | Third applicative |
returns | Zipped applicative |
method K<F, (A First, B Second, C Third, D Fourth)> Zip <F, A, B, C, D> ( this K<F, A> First, K<F, B> Second, K<F, C> Third, K<F, D> Fourth) Source #
Zips applicatives into a tuple
type | F | Applicative trait type |
type | A | First applicative's bound value type |
type | B | Second applicative's bound value type |
type | C | Third applicative's bound value type |
type | D | Fourth applicative's bound value type |
param | First | First applicative |
param | Second | Second applicative |
param | Third | Third applicative |
param | Fourth | Fourth applicative |
returns | Zipped applicative |
method K<F, (A First, B Second, C Third, D Fourth, E Fifth)> Zip <F, A, B, C, D, E> ( this K<F, A> First, K<F, B> Second, K<F, C> Third, K<F, D> Fourth, K<F, E> Fifth) Source #
Zips applicatives into a tuple
type | F | Applicative trait type |
type | A | First applicative's bound value type |
type | B | Second applicative's bound value type |
type | C | Third applicative's bound value type |
type | D | Fourth applicative's bound value type |
param | First | First applicative |
param | Second | Second applicative |
param | Third | Third applicative |
param | Fourth | Fourth applicative |
param | Fifth | Fifth applicative |
returns | Zipped applicative |
class ApplicativeLaw <F> Source #
Functions that test that Applicative-functor laws hold for the F
applicative-functor provided.
NOTE: Equals
must be implemented for the K<F, *>
derived-type, so that the laws
can be proven to be true. If your applicative-functor doesn't have Equals
then you must provide
the optional equals
parameter so that the equality of outcomes can be tested.
type | F | Applicative functor type |
method Unit assert (Func<K<F, int>, K<F, int>, bool>? equals = null) Source #
Assert that the applicative-functor laws hold
NOTE: Equals
must be implemented for the K<F, *>
derived-type, so that the laws
can be proven to be true. If your applicative-functor doesn't have Equals
then you must provide
the optional equals
parameter so that the equality of outcomes can be tested.
method Validation<Error, Unit> validate (Func<K<F, int>, K<F, int>, bool>? equals = null) Source #
Validate that the applicative-functor laws hold
NOTE: Equals
must be implemented for the K<F, *>
derived-type, so that the laws
can be proven to be true. If your applicative-functor doesn't have Equals
then you must provide
the optional equals
parameter so that the equality of outcomes can be tested.
method Validation<Error, Unit> homomorphismLaw (Func<K<F, int>, K<F, int>, bool> equals) Source #
Validate the homomorphism law
Homomorphism: pure g <*> pure x ≡ pure (g x)
NOTE: Equals
must be implemented for the K<F, *>
derived-type, so that the laws
can be proven to be true. If your applicative-functor doesn't have Equals
then you must provide
the optional equals
parameter so that the equality of outcomes can be tested.
method Validation<Error, Unit> interchangeLaw (Func<K<F, int>, K<F, int>, bool> equals) Source #
Validate the interchange law
Interchange: fs <> pure x ≡ pure ($ x) <> fs
NOTE: Equals
must be implemented for the K<F, *>
derived-type, so that the laws
can be proven to be true. If your applicative-functor doesn't have Equals
then you must provide
the optional equals
parameter so that the equality of outcomes can be tested.
method Validation<Error, Unit> identityLaw (Func<K<F, int>, K<F, int>, bool> equals) Source #
Validate the identity law
Identity: pure id <*> xs ≡ xs
NOTE: Equals
must be implemented for the K<F, *>
derived-type, so that the laws
can be proven to be true. If your applicative-functor doesn't have Equals
then you must provide
the optional equals
parameter so that the equality of outcomes can be tested.
method Validation<Error, Unit> compositionLaw (Func<K<F, int>, K<F, int>, bool> equals) Source #
Validate the composition law
Composition: (.) <$> us <> vs <> xs ≡ us <> (vs <> xs)
NOTE: Equals
must be implemented for the K<F, *>
derived-type, so that the laws
can be proven to be true. If your functor doesn't have Equals
then you must provide
the optional equals
parameter so that the equality of outcomes can be tested.
method Validation<Error, Unit> functorLaw (Func<K<F, int>, K<F, int>, bool> equals) Source #
Validate the composition law
Applicative-Functor: g <$> xs ≡ pure g <*> xs
NOTE: Equals
must be implemented for the K<F, *>
derived-type, so that the laws
can be proven to be true. If your functor doesn't have Equals
then you must provide
the optional equals
parameter so that the equality of outcomes can be tested.
class Applicative Source #
Applicative module
method K<F, Func<B, C>> apply <F, A, B, C> (K<F, Func<A, B, C>> mf, K<F, A> ma) Source #
method K<F, C> apply <F, A, B, C> (K<F, Func<A, B, C>> mf, K<F, A> ma, K<F, B> mb) Source #
method K<F, D> apply <F, A, B, C, D> (K<F, Func<A, B, C, D>> mf, K<F, A> ma, K<F, B> mb, K<F, C> mc) Source #
method K<F, Func<C, D>> apply <F, A, B, C, D> (K<F, Func<A, B, C, D>> mf, K<F, A> ma, K<F, B> mb) Source #
method K<F, Func<B,Func<C, D>>> apply <F, A, B, C, D> (K<F, Func<A, B, C, D>> mf, K<F, A> ma) Source #
method K<F, C> lift <F, A, B, C> (Func<A, B, C> f, K<F, A> fa, K<F, B> fb) Source #
method K<F, C> lift <F, A, B, C> (Func<A, Func<B, C>> f, K<F, A> fa, K<F, B> fb) Source #
method K<F, A> pure <F, A> (A value) Source #
Construct an applicative structure from a pure value
type | A | Bound value type |
param | value | Pure value to lift into the applicative structure |
returns | Applicative structure |
method K<AF, B> apply <AF, A, B> (K<AF, Func<A, B>> mf, K<AF, A> ma) Source #
method K<AF, Func<B, C>> apply <AF, A, B, C> (K<AF, Func<A, B, C>> mf, K<AF, A> ma) Source #
method K<AF, Func<B,Func<C, D>>> apply <AF, A, B, C, D> (K<AF, Func<A, B, C, D>> mf, K<AF, A> ma) Source #
method K<AF, Func<B,Func<C, Func<D, E>>>> apply <AF, A, B, C, D, E> (K<AF, Func<A, B, C, D, E>> mf, K<AF, A> ma) Source #
method K<AF, Func<B,Func<C, Func<D, Func<E, F>>>>> apply <AF, A, B, C, D, E, F> (K<AF, Func<A, B, C, D, E, F>> mf, K<AF, A> ma) Source #
method K<AF, Func<B,Func<C, Func<D, Func<E, Func<F, G>>>>>> apply <AF, A, B, C, D, E, F, G> (K<AF, Func<A, B, C, D, E, F, G>> mf, K<AF, A> ma) Source #
method K<AF, Func<B,Func<C, Func<D, Func<E, Func<F, Func<G, H>>>>>>> apply <AF, A, B, C, D, E, F, G, H> (K<AF, Func<A, B, C, D, E, F, G, H>> mf, K<AF, A> ma) Source #
method K<AF, Func<B,Func<C, Func<D, Func<E, Func<F, Func<G, Func<H, I>>>>>>>> apply <AF, A, B, C, D, E, F, G, H, I> (K<AF, Func<A, B, C, D, E, F, G, H, I>> mf, K<AF, A> ma) Source #
method K<AF, Func<B,Func<C, Func<D, Func<E, Func<F, Func<G, Func<H, Func<I, J>>>>>>>>> apply <AF, A, B, C, D, E, F, G, H, I, J> (K<AF, Func<A, B, C, D, E, F, G, H, I, J>> mf, K<AF, A> ma) Source #
method K<AF, Func<B,Func<C, Func<D, Func<E, Func<F, Func<G, Func<H, Func<I, Func<J, K>>>>>>>>>> apply <AF, A, B, C, D, E, F, G, H, I, J, K> (K<AF, Func<A, B, C, D, E, F, G, H, I, J, K>> mf, K<AF, A> ma) Source #
method K<F, (A First, B Second)> zip <F, A, B> ( (K<F, A> First, K<F, B> Second) tuple) Source #
Zips applicatives into a tuple
type | F | Applicative trait type |
type | A | First applicative's bound value type |
type | B | Second applicative's bound value type |
param | tuple | Tuple of applicatives to run |
returns | Zipped applicative |
method K<F, (A First, B Second, C Third)> zip <F, A, B, C> ( (K<F, A> First, K<F, B> Second, K<F, C> Third) tuple) Source #
Zips applicatives into a tuple
type | F | Applicative trait type |
type | A | First applicative's bound value type |
type | B | Second applicative's bound value type |
type | C | Third applicative's bound value type |
param | tuple | Tuple of applicatives to run |
returns | Zipped applicative |
method K<F, (A First, B Second, C Third, D Fourth)> zip <F, A, B, C, D> ( (K<F, A> First, K<F, B> Second, K<F, C> Third, K<F, D> Fourth) tuple) Source #
Zips applicatives into a tuple
type | F | Applicative trait type |
type | A | First applicative's bound value type |
type | B | Second applicative's bound value type |
type | C | Third applicative's bound value type |
type | D | Fourth applicative's bound value type |
param | tuple | Tuple of applicatives to run |
returns | Zipped applicative |
method K<F, (A First, B Second, C Third, D Fourth, E Fifth)> zip <F, A, B, C, D, E> ( (K<F, A> First, K<F, B> Second, K<F, C> Third, K<F, D> Fourth, K<F, E> Fifth) tuple) Source #
Zips applicatives into a tuple
type | F | Applicative trait type |
type | A | First applicative's bound value type |
type | B | Second applicative's bound value type |
type | C | Third applicative's bound value type |
type | D | Fourth applicative's bound value type |
param | tuple | Tuple of applicatives to run |
returns | Zipped applicative |
method K<F, (A First, B Second)> zip <F, A, B> ( K<F, A> First, K<F, B> Second) Source #
Zips applicatives into a tuple
type | F | Applicative trait type |
type | A | First applicative's bound value type |
type | B | Second applicative's bound value type |
param | First | First applicative |
param | Second | Second applicative |
returns | Zipped applicative |
method K<F, (A First, B Second, C Third)> zip <F, A, B, C> ( K<F, A> First, K<F, B> Second, K<F, C> Third) Source #
Zips applicatives into a tuple
type | F | Applicative trait type |
type | A | First applicative's bound value type |
type | B | Second applicative's bound value type |
type | C | Third applicative's bound value type |
param | First | First applicative |
param | Second | Second applicative |
param | Third | Third applicative |
returns | Zipped applicative |
method K<F, (A First, B Second, C Third, D Fourth)> zip <F, A, B, C, D> ( K<F, A> First, K<F, B> Second, K<F, C> Third, K<F, D> Fourth) Source #
Zips applicatives into a tuple
type | F | Applicative trait type |
type | A | First applicative's bound value type |
type | B | Second applicative's bound value type |
type | C | Third applicative's bound value type |
type | D | Fourth applicative's bound value type |
param | First | First applicative |
param | Second | Second applicative |
param | Third | Third applicative |
param | Fourth | Fourth applicative |
returns | Zipped applicative |
method K<F, (A First, B Second, C Third, D Fourth, E Fifth)> zip <F, A, B, C, D, E> ( K<F, A> First, K<F, B> Second, K<F, C> Third, K<F, D> Fourth, K<F, E> Fifth) Source #
Zips applicatives into a tuple
type | F | Applicative trait type |
type | A | First applicative's bound value type |
type | B | Second applicative's bound value type |
type | C | Third applicative's bound value type |
type | D | Fourth applicative's bound value type |
param | First | First applicative |
param | Second | Second applicative |
param | Third | Third applicative |
param | Fourth | Fourth applicative |
param | Fifth | Fifth applicative |
returns | Zipped applicative |
interface Applicative <F> Source #
Applicative functor
type | F | Functor trait type |
type | A | Bound value type |
method K<F, A> Actions <A> (params K<F, A>[] fas) Source #
Chains a sequence of applicative actions
Because this is an abstract chaining of actions, it can't actually run anything, and so if your
actions are expected to have side-effects (IO effects, for example), then you won't see them until
the resulting K<F, A>
is 'run'.
This matters for infinite streams, where the result of Actions
isn't realised at all, and so to
avoid nothing happening (no side-effects), you should override this function and unpack the IO
type within, then run that enumerable of IOs.
A good example is with the Eff
type. It's a ReaderT<IO, A>
internally:
static K<Eff<RT>, A> Actions<A>(IEnumerable<K<Eff<RT>, A>> fas) =>
new Eff<RT, A>(
new ReaderT<RT, IO, A>(
rt => fas.Select(fa => fa.RunIO(rt)).Actions()));
type | A | Bound value type |
param | fas | Actions to chain |
returns |
method K<F, A> Actions <A> (Seq<K<F, A>> fas) Source #
Chains a sequence of applicative actions
Because this is an abstract chaining of actions, it can't actually run anything, and so if your
actions are expected to have side-effects (IO effects, for example), then you won't see them until
the resulting K<F, A>
is 'run'.
This matters for infinite streams, where the result of Actions
isn't realised at all, and so to
avoid nothing happening (no side-effects), you should override this function and unpack the IO
type within, then run that enumerable of IOs.
A good example is with the Eff
type. It's a ReaderT<IO, A>
internally:
static K<Eff<RT>, A> Actions<A>(IEnumerable<K<Eff<RT>, A>> fas) =>
new Eff<RT, A>(
new ReaderT<RT, IO, A>(
rt => fas.Select(fa => fa.RunIO(rt)).Actions()));
type | A | Bound value type |
param | fas | Actions to chain |
returns |
method K<F, A> Actions <A> (IEnumerable<K<F, A>> fas) Source #
Chains a sequence of applicative actions
Because this is an abstract chaining of actions, it can't actually run anything, and so if your
actions are expected to have side effects (IO effects, for example), then you won't see them until
the resulting K<F, A>
is 'run'.
This matters for infinite streams, where the result of Actions
isn't realised at all, and so to
avoid nothing happening (no side effects), you should override this function and unpack the IO
type within, then run that enumerable of IOs.
A good example is with the Eff
type. It's a ReaderT<IO, A>
internally:
static K<Eff<RT>, A> Actions<A>(IEnumerable<K<Eff<RT>, A>> fas) =>
new Eff<RT, A>(
new ReaderT<RT, IO, A>(
rt => fas.Select(fa => fa.RunIO(rt)).Actions()));
type | A | Bound value type |
param | fas | Actions to chain |
returns |
method K<F, A> Actions <A> (IAsyncEnumerable<K<F, A>> fas) Source #
Chains a sequence of applicative actions
Because this is an abstract chaining of actions, it can't actually run anything, and so if your
actions are expected to have side effects (IO effects, for example), then you won't see them until
the resulting K<F, A>
is 'run'.
This matters for infinite streams, where the result of Actions
isn't realised at all, and so to
avoid nothing happening (no side effects), you should override this function and unpack the IO
type within, then run that enumerable of IOs.
A good example is with the Eff
type. It's a ReaderT<IO, A>
internally:
static K<Eff<RT>, A> Actions<A>(IEnumerable<K<Eff<RT>, A>> fas) =>
new Eff<RT, A>(
new ReaderT<RT, IO, A>(
rt => fas.Select(fa => fa.RunIO(rt)).Actions()));
type | A | Bound value type |
param | fas | Actions to chain |
returns |