arrow-core-data / arrow.core / Ior / toValidated

toValidated

fun toValidated(): Validated<A, B>

Returns a Validated.Valid containing the Right value or B if this is Right or Both and Validated.Invalid if this is a Left.

Example:

Right(12).toValidated() // Result: Valid(12)
Left(12).toValidated()  // Result: Invalid(12)
Both(12, "power").toValidated()  // Result: Valid("power")

Do you like Arrow?

Arrow Org
<