scala.util.Either
Type Members
final case class LeftProjection[+A, +B](e: Either[A, B]) extends Product with Serializable
Projects an Either
into a Left
.
This allows for-comprehensions over Either instances - for example
Continuing the analogy with scala.Option, a LeftProjection
declares that
Left
should be analogous to Some
in some code.
implicit final class MergeableEither[A] extends AnyVal
Allows use of a merge
method to extract values from Either instances
regardless of whether they are Left or Right.
final case class RightProjection[+A, +B](e: Either[A, B]) extends Product with Serializable
Projects an Either
into a Right
.
This allows for-comprehensions over Either instances - for example
Continuing the analogy with scala.Option, a RightProjection
declares that
Right
should be analogous to Some
in some code.
Analogous to LeftProjection
, see example usage in its documentation above.
Value Members From scala.util.Either
def cond[A, B](test: Boolean, right: ⇒ B, left: ⇒ A): Either[A, B]
If the condition is satisfied, return the given B
in Right
, otherwise,
return the given A
in Left
.
(defined at scala.util.Either)
Full Source: