Combine this validator with a validator that
which validates elements of a traversable structure extracted using the traversal t
.
Combine this validator with a validator that
which validates elements of a traversable structure extracted using the function f
.
Combine this validator with a validator that
which validates tuples of an inner value extracted using the lens l
and elements of a traversable structure extracted using the traversal t
.
Combine this validator with a validator that
which validates tuples of a single inner value extracted using the function f
and elements of a traversable structure extracted using the function g
.
Combine this validator with a validator that
which validates tuples of elements and their indices in a traversable structure extracted using the traversal t
.
Combine this validator with a validator that
which validates tuples of elements and their indices in a traversable structure extracted using the function f
.
Combine this validator with that
to produce a validator which runs both validations.
Combine this validator with that
to produce a validator which runs both validations.
This function ignores the post-processing step of the second validator that
.
Run this
validation and then that
validation on the input and if both pass, perform the post-processing of each validator in turn.
Combine this validator with a validator that
which validates an optional value at index i
of a traversable structure extracted using the function f
.
Adapt this validator to an input of type Z
using the function g
.
Adapt this validator to an input of type Z
using the function g
and maps its output using h
.
Combine this validator with a validator that
which validates an specific element of a traversable structure extracted using the traversal t
Combine this validator with a validator that
which validates an optional value at the first index of a traversable structure extracted using the function f
.
Combine this validator with a validator that
which validates an inner value extracted using the lens l
.
Combine this validator with a validator that
which validates an inner value extracted using the function f
.
Combine this validator with a validator that
which validates a tuple of inner values extracted using the lenses l
and r
.
Combine this validator with a validator that
which validates a tuple of inner values extracted using the functions f
and g
.
Transform any errors produced by this validator using the function g
.
Add an additional post-processing step g
to the output value of this validator which is applied on success.
Combine this validator with that
to produce a validator which runs both validations.
Combine this validator with that
to produce a validator which runs both validations. Use the function g
to combine the post-processed values of both validators into a single value.
Apply this validator to the inner value of an Option[A]
, passing when the Option is empty.
Combine this validator with that
, a validator for a different type, to produce a validator for Either
of this and that
's validation.
Extend this validator over an M[A]
that is traversable so that every element is validated.
Combine this validator with that
to produce a validator which runs both validations.
Combine this validator with that
to produce a validator which runs both validations.
This function runs the post-processing steps of both validators on the input and returns each of the results as a tuple.
Apply this validator to the inner element of an Option[A]
, failing with error messages e
when the Option is empty.
A specialization of runWith
which runs the validation on a
and returns errors in the default error message structure F[E]
.
A specialization of runWith
which runs the validation on a
and uses the natural transformation g
to translate the error message structure F[E]
into H[E]
.
A specialization of runWith
which is designed for use with binary type constructors (e.g.
A specialization of runWith
which is designed for use with binary type constructors (e.g. Either
, Validated
). The error message type is NonEmptyList[E]
.
Runs the validation function.
Runs the validation function. If the validation succeeds, the post-processing function of this validator f: A => B
is used to transform the result value.
Otherwise, the function g
is used to convert the error message structure produced by the validation into the desired result EE
.
The function provided here is used to select the ApplicativeError
instance that is used to lift pure values into G[_]
and to raise errors EE
.
A specialization of runWith
which runs the validation on a
and uses a G[_]
which returns no errors on failure, such as Option
.
PValidator
wraps up a validation functionvalidate: A => F[E]
which validates the inputA
and returns a structure of error messagesF[E]
.The
P
inPValidator
denotes the fact that this validation is polymorphic, in the sense that its input does not have to be of the same type as its output.This may be useful when a successful validation provides some knowledge about the value that is being validated that can be used to refine its type.
For example, a
required
validator makes use of the fact that it has ensured that anOption[A]
is not empty to safely unwrap the option's inner value.