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

toValidated

common 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:

import arrow.core.Ior

fun main() {
  Ior.Right(12).toValidated() // Result: Valid(12)
  Ior.Left(12).toValidated()  // Result: Invalid(12)
  Ior.Both(12, "power").toValidated()  // Result: Valid("power")
}

Do you like Arrow?

Arrow Org
<