A symbolic alias for zipParRight
.
A symbolic alias for zipParLeft
.
A symbolic alias for zipPar
.
A symbolic alias for log
.
Maps the successful value of this ZValidation
to the specified constant
value.
Maps the error value of this ZValidation
to the specified constant
value.
Returns whether this ZValidation
and the specified ZValidation
are
equal to each other.
Returns whether this ZValidation
and the specified ZValidation
are
equal to each other.
Transforms the value of this ZValidation
with the specified validation
function if it is a success or returns the value unchanged otherwise.
Returns a ZValidation that is this ZValidation if failing or the inner ZValidation if the outer one succeeds.
Returns a ZValidation that is this ZValidation if failing or the inner ZValidation if the outer one succeeds. In particular, the sequential aspect of this combinator precludes combining error values of outer and inner ZValidations. This method can be used to "flatten" nested ZValidation.
Folds over the error and success values of this ZValidation
.
Transforms the value of this ZValidation
with the specified effectual
function if it is a success or returns the value unchanged otherwise.
Returns the value, because no error has occurred.
Returns the value of the log.
Returns the value, if successful, or the provided fallback
value.
Returns the successful value or handles the errors that have accumulated.
Writes an entry to the log.
Transforms the successful value of this ZValidation
with the specified
function.
Transforms the error value of this ZValidation
with the specified
function.
Transforms all the error values of this ZValidation
with the specified
function.
Transforms the log entries of this ZValidation
with the specified
function.
Transforms all the log entries of this ZValidation
with the specified
function.
Exposes the result of this validation function as either a Right
with
a success of type A
or a Left
with one or more errors of type E
,
along with the log.
Transforms this ZValidation
to an Either
, discarding the log.
Transforms this ZValidation
to an Either
, aggregating errors using provided Associative
instance, discarding the log.
Transforms this ZValidation
to an Either
, discarding the order in which the errors occurred and discarding the log.
Transforms this ZValidation
to an Either
, transforming the accumulated errors and discarding the log.
Transforms this ZValidation
to an Option
, discarding information about
the errors and log.
Transforms this ZValidation
to a Try
, discarding all but the first
error and the log.
Converts this ZValidation
into a ZIO
effect, discarding the log.
Transforms this ZValidation
to an ZIO
effect, aggregating errors using provided Associative
instance, discarding the log.
Converts this ZValidation
into a ZIO
effect and exposes all parallel
errors in a single call, discarding the log.
Combines this ZValidation
with the specified ZValidation
, returning a
tuple of their results.
Combines this ZValidation
with the specified ZValidation
, returning a
tuple of their results. Returns either the combined result if both were
successes or otherwise returns a failure with all errors.
A variant of zipPar
that keeps only the left success value, but returns
a failure with all errors if either this ZValidation
or the specified
ZValidation
fail.
A variant of zipPar
that keeps only the right success value, but returns
a failure with all errors if either this ZValidation
or the specified
ZValidation
fail.
Combines this ZValidation
with the specified ZValidation
, using the
function f
to combine their success values.
Combines this ZValidation
with the specified ZValidation
, using the
function f
to combine their success values. Returns either the combined
result if both were successes or otherwise returns a failure with all
errors.
ZValidation
represents either a success of typeA
or a collection of one or more errors of typeE
along with in either case a log with entries of typeW
. UnlikeEither
,ZValidation
does not "short circuit" on failures and instead allows accumulating multiple errors. This can be particularly useful in validating data, where we want to attempt to validate all of the data and retain information about all errors that arose, rather than failing at the first error.