final case class \/-[+B](b: B) extends \/[Nothing, B] with Product with Serializable
A right disjunction
Often used to represent the success case of a result
- Source
- Either.scala
- Alphabetic
- By Inheritance
- \/-
- \/
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new \/-(b: B)
Type Members
- final class SwitchingDisjunction[X] extends AnyRef
- Definition Classes
- \/
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +++[AA >: Nothing, BB >: B](x: => \/[AA, BB])(implicit M1: Semigroup[BB], M2: Semigroup[AA]): \/[AA, BB]
Sums up values inside disjunction, if both are left or right.
Sums up values inside disjunction, if both are left or right. Returns first left otherwise.
\/-(v1) +++ \/-(v2) → \/-(v1 + v2) \/-(v1) +++ -\/(v2) → -\/(v2) -\/(v1) +++ \/-(v2) → -\/(v1) -\/(v1) +++ -\/(v2) → -\/(v1 + v2)
- Definition Classes
- \/
- def :?>>[X](right: => X): SwitchingDisjunction[X]
If this disjunction is right, return the given X value, otherwise, return the X value given to the return value.
If this disjunction is right, return the given X value, otherwise, return the X value given to the return value.
- Definition Classes
- \/
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def ===[AA >: Nothing, BB >: B](x: \/[AA, BB])(implicit EA: Equal[AA], EB: Equal[BB]): Boolean
Compare two disjunction values for equality.
Compare two disjunction values for equality.
- Definition Classes
- \/
- def @\?/[AA, BB](k: (Validation[Nothing, B]) => Validation[AA, BB]): \/[AA, BB]
Run a validation function and back to disjunction again.
Run a validation function and back to disjunction again. Alias for
validationed
- Definition Classes
- \/
- def ap[AA >: Nothing, C](f: => \/[AA, (B) => C]): \/[AA, C]
Apply a function in the environment of the right of this disjunction.
Apply a function in the environment of the right of this disjunction.
- Definition Classes
- \/
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val b: B
- def bimap[C, D](f: (Nothing) => C, g: (B) => D): \/[C, D]
Binary functor map on this disjunction.
Binary functor map on this disjunction.
- Definition Classes
- \/
- def bitraverse[F[_], C, D](f: (Nothing) => F[C], g: (B) => F[D])(implicit arg0: Functor[F]): F[\/[C, D]]
Binary functor traverse on this disjunction.
Binary functor traverse on this disjunction.
- Definition Classes
- \/
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def compare[AA >: Nothing, BB >: B](x: \/[AA, BB])(implicit EA: Order[AA], EB: Order[BB]): Ordering
Compare two disjunction values for ordering.
Compare two disjunction values for ordering.
- Definition Classes
- \/
- def ensure[AA >: Nothing](onLeft: => AA)(f: (B) => Boolean): \/[AA, B]
Ensures that the right value of this disjunction satisfies the given predicate, or returns left with the given value.
Ensures that the right value of this disjunction satisfies the given predicate, or returns left with the given value.
- Definition Classes
- \/
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def exists[BB >: B](p: (BB) => Boolean): Boolean
Return
true
if this disjunction is a right value satisfying the given predicate.Return
true
if this disjunction is a right value satisfying the given predicate.- Definition Classes
- \/
- def filter[AA >: Nothing](p: (B) => Boolean)(implicit M: Monoid[AA]): \/[AA, B]
Filter on the right of this disjunction.
Filter on the right of this disjunction.
- Definition Classes
- \/
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def flatMap[AA >: Nothing, D](g: (B) => \/[AA, D]): \/[AA, D]
Bind through the right of this disjunction.
Bind through the right of this disjunction.
- Definition Classes
- \/
- def fold[X](l: (Nothing) => X, r: (B) => X): X
Catamorphism.
Catamorphism. Run the first given function if left, otherwise, the second given function.
- Definition Classes
- \/
- def foldRight[Z](z: => Z)(f: (B, => Z) => Z): Z
Fold on the right of this disjunction.
Fold on the right of this disjunction.
- Definition Classes
- \/
- def forall[BB >: B](p: (BB) => Boolean): Boolean
Return
true
if this disjunction is a left value or the right value satisfies the given predicate.Return
true
if this disjunction is a left value or the right value satisfies the given predicate.- Definition Classes
- \/
- def foreach(g: (B) => Unit): Unit
Run the side-effect on the right of this disjunction.
Run the side-effect on the right of this disjunction.
- Definition Classes
- \/
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getOrElse[BB >: B](x: => BB): BB
Return the right value of this disjunction or the given default if left.
Return the right value of this disjunction or the given default if left. Alias for
|
- Definition Classes
- \/
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isLeft: Boolean
Return
true
if this disjunction is left.Return
true
if this disjunction is left.- Definition Classes
- \/
- def isRight: Boolean
Return
true
if this disjunction is right.Return
true
if this disjunction is right.- Definition Classes
- \/
- def leftMap[C](f: (Nothing) => C): \/[C, B]
Run the given function on the left value.
Run the given function on the left value.
- Definition Classes
- \/
- def loopl[AA >: Nothing, BB >: B, X](left: (AA) => \/[X, \/[AA, BB]], right: (BB) => X): X
Spin in tail-position on the left value of this disjunction.
Spin in tail-position on the left value of this disjunction.
- Definition Classes
- \/
- def loopr[AA >: Nothing, BB >: B, X](left: (AA) => X, right: (BB) => \/[X, \/[AA, BB]]): X
Spin in tail-position on the right value of this disjunction.
Spin in tail-position on the right value of this disjunction.
- Definition Classes
- \/
- def map[D](g: (B) => D): \/[Nothing, D]
Map on the right of this disjunction.
Map on the right of this disjunction.
- Definition Classes
- \/
- def merge[AA >: Nothing](implicit ev: <~<[B, AA]): AA
Return the value from whichever side of the disjunction is defined, given a commonly assignable type.
Return the value from whichever side of the disjunction is defined, given a commonly assignable type.
- Definition Classes
- \/
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def orElse[C, BB >: B](x: => \/[C, BB]): \/[C, BB]
Return this if it is a right, otherwise, return the given value.
Return this if it is a right, otherwise, return the given value. Alias for
|||
- Definition Classes
- \/
- def orRaiseError[F[_], AA >: Nothing, BB >: B](implicit F: MonadError[F, AA]): F[BB]
- Definition Classes
- \/
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def recover[BB >: B](pf: PartialFunction[Nothing, BB]): \/[Nothing, BB]
Run the given function on the left and return right with the result.
Run the given function on the left and return right with the result.
- Definition Classes
- \/
- def recoverWith[AA >: Nothing, BB >: B](pf: PartialFunction[AA, \/[AA, BB]]): \/[AA, BB]
Run the given function on the left and return the result.
Run the given function on the left and return the result.
- Definition Classes
- \/
- def show[AA >: Nothing, BB >: B](implicit SA: Show[AA], SB: Show[BB]): Cord
Show for a disjunction value.
Show for a disjunction value.
- Definition Classes
- \/
- def swap: \/[B, Nothing]
Flip the left/right values in this disjunction.
Flip the left/right values in this disjunction. Alias for
unary_~
- Definition Classes
- \/
- def swapped[AA, BB](k: (\/[B, Nothing]) => \/[BB, AA]): \/[AA, BB]
Run the given function on this swapped value.
Run the given function on this swapped value. Alias for
~
- Definition Classes
- \/
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toEither: Either[Nothing, B]
Convert to a core
scala.Either
at your own peril.Convert to a core
scala.Either
at your own peril.- Definition Classes
- \/
- def toList: List[B]
Return an empty list or list with one element on the right of this disjunction.
Return an empty list or list with one element on the right of this disjunction.
- Definition Classes
- \/
- def toMaybe[BB >: B]: Maybe[BB]
Return an empty maybe or option with one element on the right of this disjunction.
Return an empty maybe or option with one element on the right of this disjunction. Useful to sweep errors under the carpet.
- Definition Classes
- \/
- def toOption: Option[B]
Return an empty option or option with one element on the right of this disjunction.
Return an empty option or option with one element on the right of this disjunction. Useful to sweep errors under the carpet.
- Definition Classes
- \/
- def toStream: Stream[B]
Return an empty stream or stream with one element on the right of this disjunction.
Return an empty stream or stream with one element on the right of this disjunction.
- Definition Classes
- \/
- def toThese: \&/[Nothing, B]
Convert to a These.
Convert to a These.
- Definition Classes
- \/
- def traverse[F[_], AA >: Nothing, D](g: (B) => F[D])(implicit arg0: Applicative[F]): F[\/[AA, D]]
Traverse on the right of this disjunction.
Traverse on the right of this disjunction.
- Definition Classes
- \/
- def unary_~: \/[B, Nothing]
Flip the left/right values in this disjunction.
Flip the left/right values in this disjunction. Alias for
swap
- Definition Classes
- \/
- def validation: Validation[Nothing, B]
Convert to a Validation.
Convert to a Validation.
- Definition Classes
- \/
- def validationNel[AA >: Nothing]: ValidationNel[AA, B]
Convert to a ValidationNel.
Convert to a ValidationNel.
- Definition Classes
- \/
- def validationed[AA, BB](k: (Validation[Nothing, B]) => Validation[AA, BB]): \/[AA, BB]
Run a validation function and back to disjunction again.
Run a validation function and back to disjunction again. Alias for
@\?/
- Definition Classes
- \/
- def valueOr[BB >: B](x: (Nothing) => BB): BB
Return the right value of this disjunction or run the given function on the left.
Return the right value of this disjunction or run the given function on the left.
- Definition Classes
- \/
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def |[BB >: B](x: => BB): BB
Return the right value of this disjunction or the given default if left.
Return the right value of this disjunction or the given default if left. Alias for
getOrElse
- Definition Classes
- \/
- def |||[C, BB >: B](x: => \/[C, BB]): \/[C, BB]
Return this if it is a right, otherwise, return the given value.
Return this if it is a right, otherwise, return the given value. Alias for
orElse
- Definition Classes
- \/
- def ~[AA, BB](k: (\/[B, Nothing]) => \/[BB, AA]): \/[AA, BB]
Run the given function on this swapped value.
Run the given function on this swapped value. Alias for
swapped
- Definition Classes
- \/