MergeableEither

scala.util.Either.MergeableEither
final implicit class MergeableEither[A](x: Either[A, A]) extends AnyVal

Allows use of a merge method to extract values from Either instances regardless of whether they are Left or Right.

val l = Left(List(1)): Either[List[Int], Vector[Int]]
val r = Right(Vector(1)): Either[List[Int], Vector[Int]]
l.merge: Seq[Int] // List(1)
r.merge: Seq[Int] // Vector(1)

Attributes

Source
Either.scala
Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Value members

Concrete methods

def merge: A

Attributes

Source
Either.scala