Port of https://github.com/typelevel/cats/blob/v0.9.0/core/src/main/scala/cats/data/Ior.scala
Represents a right-biased disjunction that is either an
A, or a
B, or both an
A and a
An instance of Ior<
B> is one of:
B> is similar to Either<
B>, except that it can represent the simultaneous presence of an
A and a
B. It is right-biased so methods such as
flatMap operate on the
B value. Some methods, like
flatMap, handle the presence of two Ior.Both values using a Semigroup<
A>, while other methods, like toEither, ignore the
A value in a Ior.Both Both.
B> is isomorphic to Either<Either<
B>>, but provides methods biased toward
B values, regardless of whether the
B values appear in a Ior.Right or a Ior.Both. The isomorphic Either form can be accessed via the unwrap method.
Returns a Validated.Valid containing the Right value or
B if this is Right or Both and Validated.Invalid if this is a Left.