Class

sclib.ops.either

EitherOps

Related Doc: package either

Permalink

implicit class EitherOps[A, B] extends AnyRef

extensions on Either instances

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EitherOps
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new EitherOps(e: Either[A, B])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def bimap[AA, BB](fl: (A) ⇒ AA, fr: (B) ⇒ BB): Either[AA, BB]

    Permalink

    map both

  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def flatMap[BB](f: (B) ⇒ Either[A, BB]): Either[A, BB]

    Permalink

    apply the given function if it's a Right

  11. def flatMapO[AA](f: (A) ⇒ Either[AA, B]): Either[AA, B]

    Permalink

    apply the given function if it's a Left

    apply the given function if it's a Left

    (read as flatMap other)

    Example:
    1. scala> import sclib.ops.either._
      scala> 5.left.flatMapO(_.right)
      res0: scala.util.Either[Nothing,Int] = Right(5)
  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def getOrElse[BB >: B](or: ⇒ BB): BB

    Permalink

    get the current value if it's a Right otherwise return the given argument

  14. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. def map[BB](f: (B) ⇒ BB): Either[A, BB]

    Permalink

    apply the given function if it's a Right

  17. def mapO[AA](f: (A) ⇒ AA): Either[AA, B]

    Permalink

    apply the given function if it's a Left

    apply the given function if it's a Left

    (read as map other)

    Example:
    1. scala> import sclib.ops.either._
      scala> 5.right[Int].mapO(_ + 1)
      res0: scala.util.Either[Int,Int] = Right(5)
      scala> 5.left.mapO(_ + 1)
      res1: scala.util.Either[Int,Nothing] = Left(6)
  18. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  22. def toOption: Option[B]

    Permalink

    get the current value as a Some if it's a Right otherwise return None

  23. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  24. def toTry: Try[B]

    Permalink

    get the current value as a Success if it's a Right otherwise return Failure with the Left site

  25. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped