scala.util.Right
The right side of the disjoint union, as opposed to the scala.util.Left side.
Value Members From scala.util.Either
def fold[X](fa: (A) ⇒ X, fb: (B) ⇒ X): X
Applies fa
if this is a Left
or fb
if this is a Right
.
- fa
- the function to apply if this is a
Left
- fb
- the function to apply if this is a
Right
- returns
- the results of applying the function
- Definition Classes
Example:
(defined at scala.util.Either)
def joinLeft[A1 >: A, B1 >: B, C](implicit ev: <:<[A1, Either[C, B1]]): Either[C, B1]
Joins an Either
through Left
.
This method requires that the left side of this Either is itself an Either type.
That is, this must be some type like:
(which respects the type parameter bounds, shown below.)
If this instance is a Left[Either[C, B]] then the contained Either[C, B] will be
returned, otherwise this value will be returned unmodified.
This method, and joinRight
, are analogous to Option#flatten
(defined at scala.util.Either)
def joinRight[A1 >: A, B1 >: B, C](implicit ev: <:<[B1, Either[A1, C]]): Either[A1, C]
Joins an Either
through Right
.
This method requires that the right side of this Either is itself an Either
type. That is, this must be some type like:
(which respects the type parameter bounds, shown below.)
If this instance is a Right[Either[A, C]] then the contained Either[A, C] will
be returned, otherwise this value will be returned unmodified.
Example:
(defined at scala.util.Either)
def left: LeftProjection[A, B]
Projects this Either
as a Left
.
(defined at scala.util.Either)
def right: RightProjection[A, B]
Projects this Either
as a Right
.
(defined at scala.util.Either)
def swap: Either[B, A]
If this is a Left
, then return the left value in Right
or vice versa.
Example:
(defined at scala.util.Either)
Instance Constructors From scala.util.Right
new Right(b: B)
(defined at scala.util.Right)
Value Members From Implicit scala.util.Either.MergeableEither
def merge: B
- Implicit information
- This member is added by an implicit conversion from Right [A, B] to
MergeableEither [B] performed by method MergeableEither in scala.util.Either.
- Definition Classes
- MergeableEither
(added by implicit convertion: scala.util.Either.MergeableEither)
Full Source: