Contents
- ValidationExtensions
- Action <F, A, B> (this K<Validation<F>, A> ma, K<Validation<F>, B> mb)
- Apply <F, A, B> (this K<Validation<F>, Func<A, B>> mf, K<Validation<F>, A> ma)
- ValidationExtensions
- As <F, A> (this K<Validation<F>, A> ma)
- As2 <F, A> (this K<Validation, F, A> ma)
- Combine <F, A> (this K<Validation<F>, A> lhs, K<Validation<F>, A> rhs)
- Choose <F, A> (this K<Validation<F>, A> lhs, K<Validation<F>, A> rhs)
- Success <F, A> (this K<Validation<F>, A> ma, Action<A> success)
- Success <F, A, B> (this K<Validation<F>, A> ma, Func<A, B> success)
- Flatten <F, A> (this Validation<F, Validation<F, A>> mma)
- Filter <F, A> (this K<Validation<F>, A> ma, Func<A, bool> pred)
- Where <F, A> (this K<Validation<F>, A> ma, Func<A, bool> pred)
- Successes <F, S> (this IEnumerable<Validation<F, S>> vs)
- Fails <F, S> (this IEnumerable<Validation<F, S>> vs)
- Successes <F, S> (this Seq<Validation<F, S>> vs)
- Fails <F, S> (this Seq<Validation<F, S>> vs)
- ToFin <A> (this Validation<Error, A> ma)
- CombineI <F, A> ( this Validation<F, Seq<A>> lhs, Validation<F, A> rhs, Option<SemigroupInstance<F>> trait)
- ValidationExtensions
- Map <F, A, B> (this Func<A, B> f, K<Validation<F>, A> ma)
- Map <F, A, B> (this Func<A, B> f, Validation<F, A> ma)
- ValidationGuardExtensions
class ValidationExtensions Source #
Methods
method Validation<F, B> Action <F, A, B> (this K<Validation<F>, A> ma, K<Validation<F>, B> mb) Source #
Applicative action: runs the first applicative, ignores the result, and returns the second applicative
method Validation<F, B> Apply <F, A, B> (this K<Validation<F>, Func<A, B>> mf, K<Validation<F>, A> ma) Source #
Applicative-functor apply-operation
Unwraps the value within the ma applicative-functor, passes it to the unwrapped function(s) within mf, and
then takes the resulting value and wraps it back up into a new applicative-functor.
Parameters
| param | ma | Value(s) applicative functor |
| param | mf | Mapping function(s) |
| returns | Mapped applicative functor | |
class ValidationExtensions Source #
Methods
method Validation<F, A> Combine <F, A> (this K<Validation<F>, A> lhs, K<Validation<F>, A> rhs) Source #
method Validation<F, A> Choose <F, A> (this K<Validation<F>, A> lhs, K<Validation<F>, A> rhs) Source #
method ValidationUnitContext<F, A> Success <F, A> (this K<Validation<F>, A> ma, Action<A> success) Source #
Match Success and return a context. You must follow this with .Fail(...) to complete the match
Parameters
| param | success | Action to invoke if in a Success state |
| returns | Context that must have | |
method ValidationContext<F, A, B> Success <F, A, B> (this K<Validation<F>, A> ma, Func<A, B> success) Source #
Match Success and return a context. You must follow this with .Fail(...) to complete the match
Parameters
| param | success | Action to invoke if in a Success state |
| returns | Context that must have | |
method Validation<F, A> Flatten <F, A> (this Validation<F, Validation<F, A>> mma) Source #
Monadic join
method Validation<F, A> Filter <F, A> (this K<Validation<F>, A> ma, Func<A, bool> pred) Source #
Filter the Validation
If the predicate returns false, then the Validation goes into a failed state using Monoid.Empty of F as
its failure value.
method Validation<F, A> Where <F, A> (this K<Validation<F>, A> ma, Func<A, bool> pred) Source #
Filter the Validation
If the predicate returns false, then the Validation goes into a failed state using Monoid.Empty of F as
its failure value.
method IEnumerable<S> Successes <F, S> (this IEnumerable<Validation<F, S>> vs) Source #
Extract only the successes
Parameters
| type | F | Fail type |
| type | S | Success type |
| param | vs | Enumerable of validations |
| returns | Enumerable of successes | |
method IEnumerable<F> Fails <F, S> (this IEnumerable<Validation<F, S>> vs) Source #
Extract only the failures
Parameters
| type | F | Fail type |
| type | S | Success type |
| param | vs | Enumerable of validations |
| returns | Enumerable of failures | |
method Seq<S> Successes <F, S> (this Seq<Validation<F, S>> vs) Source #
Extract only the successes
Parameters
| type | F | Fail type |
| type | S | Success type |
| param | vs | Seq of validations |
| returns | Enumerable of successes | |
method Seq<F> Fails <F, S> (this Seq<Validation<F, S>> vs) Source #
Extract only the failures
Parameters
| type | F | Fail type |
| type | S | Success type |
| param | vs | Seq of validations |
| returns | Enumerable of failures | |
class ValidationExtensions Source #
Methods
method Validation<F, B> Map <F, A, B> (this Func<A, B> f, K<Validation<F>, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f provided, and
then takes the mapped value and wraps it back up into a new functor.
Parameters
| param | ma | Functor to map |
| param | f | Mapping function |
| returns | Mapped functor | |
method Validation<F, B> Map <F, A, B> (this Func<A, B> f, Validation<F, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f provided, and
then takes the mapped value and wraps it back up into a new functor.
Parameters
| param | ma | Functor to map |
| param | f | Mapping function |
| returns | Mapped functor | |
class ValidationGuardExtensions Source #
Methods
method Validation<F, Unit> ToValidation <F> (this Guard<F, Unit> guard) Source #
Natural transformation to Validation
method Validation<F, B> Bind <F, B> ( this Guard<F, Unit> guard, Func<Unit, Validation<F, B>> f) Source #
Monadic binding support for Validation
method Validation<F, C> SelectMany <F, B, C> ( this Guard<F, Unit> guard, Func<Unit, Validation<F, B>> bind, Func<Unit, B, C> project) Source #
Monadic binding support for Validation