Convert a scala.util.Either
into a cats.data.Xor.
Convert a scala.util.Either
into a cats.data.Xor.
Example:
scala> import cats.data.Xor scala> import cats.syntax.either._ scala> val i: Either[String, Int] = Right(3) scala> i.toXor res0: Xor[String, Int] = Right(3) scala> val s: Either[String, Int] = Left("error!") scala> s.toXor res0: Xor[String, Int] = Left(error!)