- Validation <F, A>
- Success (A value)
- Fail (F value)
- IsSuccess
- IsFail
- Match <B> (Func<A, B> Succ, Func<F, B> Fail)
- FailSpan ()
- SuccessSpan ()
- CompareTo <OrdF, OrdA> (Validation<F, A> other)
- Equals <EqF, EqA> (Validation<F, A> other)
- Map <B> (Func<A, B> f)
- BiMap <F1, A1> (Func<A, A1> Succ, Func<F, F1> Fail)
- Bind <B> (Func<A, Validation<F, B>> f)
- BiBind <F1, A1> ( Func<A, Validation<F1, A1>> Succ, Func<F, Validation<F1, A1>> Fail)
- BindFail <F1> ( Func<F, Validation<F1, A>> Fail)
- Empty
- Match (Action<A> Succ, Action<F> Fail)
- IfFail (Func<A> Fail)
- IfFail (Func<F, A> failMap)
- IfFail (A successValue)
- IfFail (Action<F> Fail)
- IfRight (Action<A> Success)
- Success (Action<A> success)
- Success <B> (Func<A, B> success)
- CompareTo (object? obj)
- GetEnumerator ()
- FailToList ()
- FailToArray ()
- ToList ()
- ToArray ()
- ToSeq ()
- FailToSeq ()
- ToEither ()
- ToOption ()
- ToStream <M> ()
- FailToStream <M> ()
- >> (Validation<F, A> lhs, Validation<F, A> rhs)
- < (Validation<F, A> lhs, Fail<F> rhs)
- <= (Validation<F, A> lhs, Fail<F> rhs)
- > (Validation<F, A> lhs, Fail<F> rhs)
- >= (Validation<F, A> lhs, Fail<F> rhs)
- < (Validation<F, A> lhs, Pure<A> rhs)
- <= (Validation<F, A> lhs, Pure<A> rhs)
- > (Validation<F, A> lhs, Pure<A> rhs)
- >= (Validation<F, A> lhs, Pure<A> rhs)
- < (Fail<F> lhs, Validation<F, A> rhs)
- <= (Fail<F> lhs, Validation<F, A> rhs)
- > (Fail<F> lhs, Validation<F, A>rhs)
- >= (Fail<F> lhs, Validation<F, A> rhs)
- < (Pure<A> lhs, Validation<F, A> rhs)
- <= (Pure<A> lhs, Validation<F, A> rhs)
- > (Pure<A> lhs, Validation<F, A> rhs)
- >= (Pure<A> lhs, Validation<F, A> rhs)
- < (Validation<F, A> lhs, Validation<F, A> rhs)
- <= (Validation<F, A> lhs, Validation<F, A> rhs)
- > (Validation<F, A> lhs, Validation<F, A> rhs)
- >= (Validation<F, A> lhs, Validation<F, A> rhs)
- == (Validation<F, A> lhs, Fail<F> rhs)
- == (Validation<F, A> lhs, Pure<A> rhs)
- == (Fail<F> lhs, Validation<F, A> rhs)
- == (Pure<A> lhs, Validation<F, A> rhs)
- != (Validation<F, A> lhs, Fail<F> rhs)
- != (Validation<F, A> lhs, Pure<A> rhs)
- != (Fail<F> lhs, Validation<F, A> rhs)
- != (Pure<A> lhs, Validation<F, A> rhs)
- + (Validation<F, A> lhs, Validation<F, A> rhs)
- + (K<Validation<F>, A> lhs, Validation<F, A> rhs)
- + (Validation<F, A> lhs, K<Validation<F>, A> rhs)
- + (Validation<F, A> lhs, A rhs)
- + (Validation<F, A> lhs, Pure<A> rhs)
- + (Validation<F, A> lhs, Fail<F> rhs)
- + (Validation<F, A> lhs, F rhs)
- | (Validation<F, A> lhs, Validation<F, A> rhs)
- | (K<Validation<F>, A> lhs, Validation<F, A> rhs)
- | (Validation<F, A> lhs, K<Validation<F>, A> rhs)
- | (Validation<F, A> lhs, A rhs)
- | (Validation<F, A> lhs, Pure<A> rhs)
- | (Validation<F, A> lhs, Fail<F> rhs)
- | (Validation<F, A> lhs, F rhs)
- | (Validation<F, A> lhs, CatchM<F, Validation<F>, A> rhs)
- & (Validation<F, A> lhs, Validation<F, A> rhs)
- & (Validation<F, Seq<A>> lhs, Validation<F, A> rhs)
- & (Validation<F, A> lhs, Validation<F, Seq<A>> rhs)
- true (Validation<F, A> value)
- false (Validation<F, A> value)
- CompareTo (Validation<F, A>? other)
- CompareTo <OrdR> (Validation<F, A> other)
- CompareTo (Fail<F> other)
- CompareTo (Pure<A> other)
- CompareTo (A? other)
- CompareTo (F? other)
- Equals (A? other)
- Equals (F? other)
- Equals (Validation<F, A>? other)
- Equals <EqR> (Validation<F, A> other)
- Equals (Fail<F> other)
- Equals (Pure<A> other)
- MatchUntyped <B> (Func<object?, B> Succ, Func<object?, B> Fail)
- Iter (Action<A> Succ)
- ForAll (Func<A, bool> Succ)
- BiForAll (Func<A, bool> Succ, Func<F, bool> Fail)
- Fold <S> (S state, Func<S, A, S> Succ)
- BiFold <S> (S state, Func<S, A, S> Succ, Func<S, F, S> Fail)
- Exists (Func<A, bool> pred)
- Do (Action<A> f)
- Traverse <AF, B> (Func<A, K<AF, B>> f)
- MapFail <F1> (Func<F, F1> f)
- Bind <B> (Func<A, K<Validation<F>, B>> f)
- Filter (Func<A, bool> pred)
- Where (Func<A, bool> pred)
- Select <B> (Func<A, B> f)
- SelectMany <S, B> (Func<A, Validation<F, S>> bind, Func<A, S, B> project)
- Bind <B> (Func<A, Pure<B>> f)
- Bind (Func<A, Fail<F>> f)
- Bind (Func<A, Guard<F, Unit>> f)
- SelectMany <B, C> (Func<A, Pure<B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, Fail<F>> bind, Func<A, B, C> _)
- SelectMany <C> ( Func<A, Guard<F, Unit>> f, Func<A, Unit, C> project)
- GetHashCode ()
- ValidationContext <F, A, B>
- ValidationUnitContext <F, A>
- ValidationExtensions
- As <F, A> (this K<Validation<F>, A> ma)
- Flatten <L, A> (this Validation<L, Validation<L, A>> mma)
- 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)
- 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)
- Action <F, A, B> (this Validation<F, A> ma, K<Validation<F>, B> mb)
- Action <F, A, B> (this K<Validation<F>, A> ma, K<Validation<F>, B> mb)
- Apply <F, A, B> (this Validation<F, Func<A, B>> mf, K<Validation<F>, A> ma)
- Apply <F, A, B> (this K<Validation<F>, Func<A, B>> mf, K<Validation<F>, A> ma)
- Fail <F, A> (F Value)
- IsSuccess
- IsFail
- Match <B> (Func<A, B> Succ, Func<F, B> Fail)
- ToString ()
- GetHashCode ()
- FailSpan ()
- SuccessSpan ()
- CompareTo <OrdF, OrdA> (Validation<F, A> other)
- Equals <EqF, EqA> (Validation<F, A> other)
- Map <B> (Func<A, B> f)
- BiMap <L2, R2> (Func<A, R2> Succ, Func<F, L2> Fail)
- Bind <B> (Func<A, Validation<F, B>> f)
- BiBind <L2, R2> ( Func<A, Validation<L2, R2>> Succ, Func<F, Validation<L2, R2>> Fail)
- Validation
- ValidationGuardExtensions
- Validation <FAIL>
- Prelude
- Prelude
- map <F, A, B> (Func<A, B> f, K<Validation<F>, A> ma)
- action <F, A, B> (K<Validation<F>, A> ma, K<Validation<F>, B> mb)
- apply <F, A, B> (K<Validation<F>, Func<A, B>> mf, K<Validation<F>, A> ma)
- Success <F, A> (A Value)
- IsSuccess
- IsFail
- Match <B> ( Func<A, B> Succ, Func<F, B> Fail)
- ToString ()
- GetHashCode ()
- FailSpan ()
- SuccessSpan ()
- CompareTo <OrdF, OrdA> (Validation<F, A> other)
- Equals <EqF, EqA> (Validation<F, A> other)
- Map <B> (Func<A, B> f)
- BiMap <L2, R2> ( Func<A, R2> Succ, Func<F, L2> Left)
- Bind <B> (Func<A, Validation<F, B>> f)
- BiBind <L2, R2> ( Func<A, Validation<L2, R2>> Succ, Func<F, Validation<L2, R2>> Fail)
- Validation
record Validation <F, A> Source #
Like Either
but collects the failed values
type | MonoidFail | |
type | F | |
type | A |
method B Match <B> (Func<A, B> Succ, Func<F, B> Fail) Source #
Invokes the Success or Fail function depending on the state of the Validation
type | B | Return type |
param | Fail | Function to invoke if in a Fail state |
param | Succ | Function to invoke if in a Success state |
returns | The return value of the invoked function |
method ReadOnlySpan<A> SuccessSpan () Source #
Span of right value
method int CompareTo <OrdF, OrdA> (Validation<F, A> other) Source #
Compare this structure to another to find its relative ordering
method bool Equals <EqF, EqA> (Validation<F, A> other) Source #
Equality override
method Validation<F, B> Map <B> (Func<A, B> f) Source #
Maps the value in the Validation if it's in a Success state
type | F | Fail |
type | A | Success |
type | B | Mapped Validation type |
param | f | Map function |
returns | Mapped Validation |
method Validation<F1, A1> BiMap <F1, A1> (Func<A, A1> Succ, Func<F, F1> Fail) Source #
Bi-maps the value in the Validation if it's in a Success state
type | F | Fail |
type | A | Success |
type | F1 | Fail return |
type | A1 | Success return |
param | Succ | Success map function |
param | Fail | Fail map function |
returns | Mapped Validation |
method Validation<F, B> Bind <B> (Func<A, Validation<F, B>> f) Source #
Monadic bind
type | F | Fail |
type | A | Success |
type | B | Resulting bound value |
param | f | Bind function |
returns | Bound Validation |
method Validation<F1, A1> BiBind <F1, A1> ( Func<A, Validation<F1, A1>> Succ, Func<F, Validation<F1, A1>> Fail) Source #
Bi-bind. Allows mapping of both monad states
method Validation<F1, A> BindFail <F1> ( Func<F, Validation<F1, A>> Fail) Source #
Bind the failure
method Unit Match (Action<A> Succ, Action<F> Fail) Source #
Invokes the Succ
or Fail
action depending on the state of the value
param | Succ | Action to invoke if in a Success state |
param | Fail | Action to invoke if in a Fail state |
returns | Unit |
method A IfFail (Func<A> Fail) Source #
Executes the Fail
function if the value is in a Fail state.
Returns the Success value if the value is in a Success state.
param | Fail | Function to generate a value if in the Fail state |
returns | Returns an unwrapped value |
method A IfFail (Func<F, A> failMap) Source #
Executes the failMap
function if the value is in a Fail state.
Returns the Success value if in a Success state.
param | failMap | Function to generate a value if in the Fail state |
returns | Returns an unwrapped value |
method A IfFail (A successValue) Source #
Returns the successValue
if in a Fail state.
Returns the Success value if in a Success state.
param | successValue | Value to return if in the Fail state |
returns | Returns an unwrapped value |
method Unit IfFail (Action<F> Fail) Source #
Executes the Fail action if in a Fail state.
param | Fail | Function to generate a Success value if in the Fail state |
returns | Returns unit |
method Unit IfRight (Action<A> Success) Source #
Invokes the Success
action if in a Success state, otherwise does nothing
param | Success | Action to invoke |
returns | Unit |
method ValidationUnitContext<F, A> Success (Action<A> success) Source #
Match Success and return a context. You must follow this with .Fail(...)
to complete the match
param | success | Action to invoke if in a Success state |
returns | Context that must have |
method ValidationContext<F, A, B> Success <B> (Func<A, B> success) Source #
Match Success and return a context. You must follow this with .Fail(...)
to complete the match
param | success | Action to invoke if in a Success state |
returns | Context that must have |
method IEnumerator<A> GetEnumerator () Source #
method Lst<F> FailToList () Source #
Project the value into a Lst<F>
returns | If in a Fail state, a |
method Arr<F> FailToArray () Source #
Project into an Arr<F>
returns | If in a Fail state, a |
method Lst<A> ToList () Source #
Project into a Lst<A>
returns | If in a Success state, a |
method Arr<A> ToArray () Source #
Project into an Arr<A>
returns | If in a Success state, an |
method int CompareTo <OrdR> (Validation<F, A> other) Source #
CompareTo override
method B MatchUntyped <B> (Func<object?, B> Succ, Func<object?, B> Fail) Source #
Match the Success and Fail values but as untyped objects.
method Unit Iter (Action<A> Succ) Source #
Iterate the value action is invoked if in the Success state
method bool ForAll (Func<A, bool> Succ) Source #
Invokes a predicate on the success value if it's in the Success state
returns | True if in a |
method bool BiForAll (Func<A, bool> Succ, Func<F, bool> Fail) Source #
Invokes a predicate on the values
type | L | Left |
type | R | Right |
param | self | Either to forall |
param | Succ | Predicate |
param | Fail | Predicate |
returns | True if either Predicate returns true |
method S Fold <S> (S state, Func<S, A, S> Succ) Source #
Validation types are like lists of 0 or 1 items and therefore follow the same rules when folding.
type | S | Aggregate state type |
param | state | Initial state |
param | Succ | Folder function, applied if structure is in a Success state |
returns | The aggregate state |
method S BiFold <S> (S state, Func<S, A, S> Succ, Func<S, F, S> Fail) Source #
Either types are like lists of 0 or 1 items, and therefore follow the Validation types are like lists of 0 or 1 items and therefore follow the same rules when folding.
type | S | Aggregate state type |
param | state | Initial state |
param | Succ | Folder function, applied if in a Success state |
param | Fail | Folder function, applied if in a Fail state |
returns | The aggregate state |
method bool Exists (Func<A, bool> pred) Source #
Invokes a predicate on the value if it's in the Success state
param | pred | Predicate |
returns | True if in a Success state and the predicate returns |
method Validation<F, A> Do (Action<A> f) Source #
Impure iteration of the bound values in the structure
returns | Returns the original unmodified structure |
method K<AF, Validation<F, B>> Traverse <AF, B> (Func<A, K<AF, B>> f) Source #
Map each element of a structure to an action, evaluate these actions from left to right, and collect the results.
type | F | Applicative functor trait |
type | B | Bound value (output) |
param | f | |
param | ta | Traversable structure |
method Validation<F1, A> MapFail <F1> (Func<F, F1> f) Source #
Maps the value in the Either if it's in a Left state
type | L | Left |
type | R | Right |
type | F1 | Mapped Either type |
param | f | Map function |
returns | Mapped Either |
method Validation<F, B> Bind <B> (Func<A, K<Validation<F>, B>> f) Source #
Monadic bind
type | L | Left |
type | R | Right |
type | B | |
param | f | |
returns | Bound Either |
method Validation<F, A> Filter (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 (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, B> SelectMany <S, B> (Func<A, Validation<F, S>> bind, Func<A, S, B> project) Source #
Monadic bind function
method Validation<F, Unit> Bind (Func<A, Guard<F, Unit>> f) Source #
Monadic bind
param | f | Bind function |
method Validation<F, C> SelectMany <B, C> (Func<A, Pure<B>> bind, Func<A, B, C> project) Source #
Monadic bind and project
param | bind | Bind function |
param | project | Project function |
method Validation<F, C> SelectMany <B, C> (Func<A, Fail<F>> bind, Func<A, B, C> _) Source #
Monadic bind and project
param | bind | Bind function |
param | project | Project function |
method Validation<F, C> SelectMany <C> ( Func<A, Guard<F, Unit>> f, Func<A, Unit, C> project) Source #
Monadic bind and project
param | bind | Bind function |
param | project | Project function |
method int GetHashCode () Source #
operator < (Validation<F, A> lhs, Fail<F> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs < rhs |
operator <= (Validation<F, A> lhs, Fail<F> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs < rhs |
operator > (Validation<F, A> lhs, Fail<F> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs < rhs |
operator >= (Validation<F, A> lhs, Fail<F> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs < rhs |
operator < (Validation<F, A> lhs, Pure<A> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs < rhs |
operator <= (Validation<F, A> lhs, Pure<A> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs < rhs |
operator > (Validation<F, A> lhs, Pure<A> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs < rhs |
operator >= (Validation<F, A> lhs, Pure<A> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs < rhs |
operator < (Fail<F> lhs, Validation<F, A> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs < rhs |
operator <= (Fail<F> lhs, Validation<F, A> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs < rhs |
operator > (Fail<F> lhs, Validation<F, A>rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs < rhs |
operator >= (Fail<F> lhs, Validation<F, A> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs < rhs |
operator < (Pure<A> lhs, Validation<F, A> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs < rhs |
operator <= (Pure<A> lhs, Validation<F, A> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs < rhs |
operator > (Pure<A> lhs, Validation<F, A> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs < rhs |
operator >= (Pure<A> lhs, Validation<F, A> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs < rhs |
operator < (Validation<F, A> lhs, Validation<F, A> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs < rhs |
operator <= (Validation<F, A> lhs, Validation<F, A> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs <= rhs |
operator > (Validation<F, A> lhs, Validation<F, A> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs > rhs |
operator >= (Validation<F, A> lhs, Validation<F, A> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs >= rhs |
operator + (Validation<F, A> lhs, Validation<F, A> rhs) Source #
Combine operator: uses the underlying F.Combine
to collect failures
operator + (K<Validation<F>, A> lhs, Validation<F, A> rhs) Source #
Combine operator: uses the underlying F.Combine
to collect failures
operator + (Validation<F, A> lhs, K<Validation<F>, A> rhs) Source #
Combine operator: uses the underlying F.Combine
to collect failures
operator + (Validation<F, A> lhs, A rhs) Source #
Combine operator: uses the underlying F.Combine
to collect failures
operator + (Validation<F, A> lhs, Pure<A> rhs) Source #
Combine operator: uses the underlying F.Combine
to collect failures
operator + (Validation<F, A> lhs, Fail<F> rhs) Source #
Combine operator: uses the underlying F.Combine
to collect failures
operator + (Validation<F, A> lhs, F rhs) Source #
Combine operator: uses the underlying F.Combine
to collect failures
operator | (Validation<F, A> lhs, Validation<F, A> rhs) Source #
Choice operator: returns the first argument to succeed. If both fail, then the last failure is returned.
operator | (K<Validation<F>, A> lhs, Validation<F, A> rhs) Source #
Choice operator: returns the first argument to succeed. If both fail, then the last failure is returned.
operator | (Validation<F, A> lhs, K<Validation<F>, A> rhs) Source #
Choice operator: returns the first argument to succeed. If both fail, then the last failure is returned.
operator | (Validation<F, A> lhs, A rhs) Source #
Choice operator: returns the first argument to succeed. If both fail, then the last failure is returned.
operator | (Validation<F, A> lhs, Pure<A> rhs) Source #
Choice operator: returns the first argument to succeed. If both fail, then the last failure is returned.
operator | (Validation<F, A> lhs, Fail<F> rhs) Source #
Choice operator: returns the first argument to succeed. If both fail, then the last failure is returned.
operator | (Validation<F, A> lhs, F rhs) Source #
Choice operator: returns the first argument to succeed. If both fail, then the last failure is returned.
operator | (Validation<F, A> lhs, CatchM<F, Validation<F>, A> rhs) Source #
Catch operator: returns the first argument if it to succeeds. Otherwise, the F
failure is mapped.
operator & (Validation<F, A> lhs, Validation<F, A> rhs) Source #
If any items are Fail then the errors are collected and returned. If they
all pass then the Success values are collected into a Seq
.
operator & (Validation<F, Seq<A>> lhs, Validation<F, A> rhs) Source #
If any items are Fail then the errors are collected and returned. If they
all pass then the Success values are collected into a Seq
.
operator & (Validation<F, A> lhs, Validation<F, Seq<A>> rhs) Source #
If any items are Fail then the errors are collected and returned. If they
all pass then the Success values are collected into a Seq
.
struct ValidationContext <F, A, B> Source #
Context for the fluent Either matching
struct ValidationUnitContext <F, A> Source #
Context for the fluent Validation matching
class ValidationExtensions Source #
method Validation<L, A> Flatten <L, A> (this Validation<L, Validation<L, A>> mma) Source #
Monadic join
method IEnumerable<S> Successes <F, S> (this IEnumerable<Validation<F, S>> vs) Source #
Extract only the successes
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
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
type | F | Fail type |
type | S | Success type |
param | vs | Seq of validations |
returns | Enumerable of successes |
class ValidationExtensions Source #
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.
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.
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method Validation<F, B> Action <F, A, B> (this 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> 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 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.
param | ma | Value(s) applicative functor |
param | mf | Mapping function(s) |
returns | Mapped applicative functor |
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.
param | ma | Value(s) applicative functor |
param | mf | Mapping function(s) |
returns | Mapped applicative functor |
record Fail <F, A> (F Value) Source #
method B Match <B> (Func<A, B> Succ, Func<F, B> Fail) Source #
Invokes the Success or Fail function depending on the state of the Validation
type | B | Return type |
param | Succ | Function to invoke if in a Success state |
param | Fail | Function to invoke if in a Fail state |
returns | The return value of the invoked function |
method int GetHashCode () Source #
Get a hash code for the structure
method ReadOnlySpan<A> SuccessSpan () Source #
Empty span
method int CompareTo <OrdF, OrdA> (Validation<F, A> other) Source #
Compare this structure to another to find its relative ordering
method Validation<F, B> Map <B> (Func<A, B> f) Source #
Maps the value in the Validation if it's in a Success state
type | F | Fail |
type | A | Success |
type | B | Mapped Validation type |
param | f | Map function |
returns | Mapped Validation |
method Validation<L2, R2> BiMap <L2, R2> (Func<A, R2> Succ, Func<F, L2> Fail) Source #
Bi-maps the value in the Validation if it's in a Success state
type | F | Fail |
type | A | Success |
type | L2 | Fail return |
type | R2 | Success return |
param | Succ | Success map function |
param | Fail | Fail map function |
returns | Mapped Validation |
class Validation Source #
class ValidationGuardExtensions Source #
method Validation<F, C> SelectMany <F, A, C> ( this Validation<F, A> ma, Func<A, Guard<F, Unit>> f, Func<A, Unit, C> project) Source #
class Validation <FAIL> Source #
Trait implementation for Validation
type | M | Given monad trait |
method Validation<F, A> Success <F, A> (A value) Source #
Represents a successful operation
type | F | Error type |
type | A | Value type |
param | value | Value |
returns | Validation applicative |
method Validation<F, B> map <F, A, B> (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.
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method Validation<F, B> action <F, A, B> (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> (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.
param | ma | Value(s) applicative functor |
param | mf | Mapping function(s) |
returns | Mapped applicative functor |
record Success <F, A> (A Value) Source #
method B Match <B> ( Func<A, B> Succ, Func<F, B> Fail) Source #
Invokes the Success or Left function depending on the state of the Validation
type | B | Return type |
param | Left | Function to invoke if in a Left state |
param | Success | Function to invoke if in a Success state |
returns | The return value of the invoked function |
method int GetHashCode () Source #
Get a hash code for the structure
method ReadOnlySpan<A> SuccessSpan () Source #
Span of right value
method int CompareTo <OrdF, OrdA> (Validation<F, A> other) Source #
Compare this structure to another to find its relative ordering
method Validation<F, B> Map <B> (Func<A, B> f) Source #
Maps the value in the Validation if it's in a Success state
type | F | Left |
type | A | Success |
type | B | Mapped Validation type |
param | f | Map function |
returns | Mapped Validation |
method Validation<L2, R2> BiMap <L2, R2> ( Func<A, R2> Succ, Func<F, L2> Left) Source #
Bi-maps the value in the Validation if it's in a Success state
type | F | Left |
type | A | Success |
type | L2 | Left return |
type | R2 | Success return |
param | Success | Success map function |
param | Left | Left map function |
returns | Mapped Validation |
class Validation Source #