MODULE Validation
data
type Validation<L, A> = Failure<L, A> | Success<L, A>
The Validation
functor, used for applicative validation
The Applicative
instance collects multiple failures in an arbitrary Semigroup
.
<V, B>(f: (l: L) => V, g: (a: A) => B): Validation<V, B>
<B>(failure: (l: L) => B, success: (a: A) => B): B
(a: A): A
Returns the value from this Success
or the given argument if this is a Failure
(f: (l: L) => A): A
Returns the value from this Success
or the result of given argument if this is a Failure
(): string
(): this is Failure<L, A>
Returns true
if the validation is an instance of Failure
, false
otherwise
(): this is Success<L, A>
Returns true
if the validation is an instance of Success
, false
otherwise
<B>(f: (a: A) => B): Validation<L, B>
<M>(f: (l: L) => M): Validation<M, A>
<B>(b: B, f: (b: B, a: A) => B): B
(): Validation<A, L>
(): string
instance
Functor2<URI> & Foldable2<URI> & Traversable2<URI>
function
<L, A>(l: L): Validation<L, A>
function
<L, A>(e: Either<L, A>): Validation<L, A>
function
<L, A>(predicate: Predicate<A>, f: (a: A) => L) => (a: A): Validation<L, A>
function
<L>(S: Semigroup<L>): Alt2C<URI, L>
function
<L>(S: Semigroup<L>): Applicative2C<URI, L>
function
<L>(S: Semigroup<L>): Monad2C<URI, L>
function
<L, A>(SL: Semigroup<L>, SA: Monoid<A>): Monoid<Validation<L, A>>
function
<L, A>(SL: Semigroup<L>, SA: Semigroup<A>): Semigroup<Validation<L, A>>
function
<L, A>(SL: Setoid<L>, SA: Setoid<A>): Setoid<Validation<L, A>>
function
<L, A>(fa: Validation<L, A>): fa is Failure<L, A>
Returns true
if the validation is an instance of Failure
, false
otherwise
function
<L, A>(fa: Validation<L, A>): fa is Success<L, A>
Returns true
if the validation is an instance of Success
, false
otherwise
function Alias of
of