Packages

final case class EitherT[F[_], A, B](run: F[\/[A, B]]) extends Product with Serializable

Represents a computation of type F[A \/ B].

Example:

val x: Option[String \/ Int] = Some(\/-(1))
EitherT(x).map(1+).run // Some(\/-(2))
Source
EitherT.scala
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EitherT
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new EitherT(run: F[\/[A, B]])

Type Members

  1. final class Switching_\/[X] extends AnyRef

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +++(x: ⇒ EitherT[F, A, B])(implicit M1: Semigroup[B], M2: Semigroup[A], F: Apply[F]): EitherT[F, A, B]

    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)
  4. def :?>>[X](right: ⇒ X): Switching_\/[X]

    If this disjunction is right, return the given X value, otherwise, return the X value given to the return value.

  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def ===(x: EitherT[F, A, B])(implicit EA: Equal[A], EB: Equal[B], F: Apply[F]): F[Boolean]

    Compare two disjunction values for equality.

  7. def app[C](f: ⇒ EitherT[F, A, (B) ⇒ C])(implicit F: Apply[F]): EitherT[F, A, 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. Because it runs my F even when f's \/ fails, it is not consistent with ap.

  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def bimap[C, D](f: (A) ⇒ C, g: (B) ⇒ D)(implicit F: Functor[F]): EitherT[F, C, D]

    Binary functor map on this disjunction.

  10. def bitraverse[G[_], C, D](f: (A) ⇒ G[C], g: (B) ⇒ G[D])(implicit F: Traverse[F], G: Applicative[G]): G[EitherT[F, C, D]]

    Binary functor traverse on this disjunction.

  11. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws(classOf[java.lang.CloneNotSupportedException])
  12. def compare(x: EitherT[F, A, B])(implicit EA: Order[A], EB: Order[B], F: Apply[F]): F[Ordering]

    Compare two disjunction values for ordering.

  13. def cozip(implicit Z: Cozip[F]): \/[F[A], F[B]]

    Cozip this disjunction on its functor.

  14. def ensure(onLeft: ⇒ A)(f: (B) ⇒ Boolean)(implicit F: Functor[F]): EitherT[F, A, B]

    Ensures that the right value of this disjunction satisfies the given predicate, or returns left with the given value.

  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def exists(f: (B) ⇒ Boolean)(implicit F: Functor[F]): F[Boolean]

    Return true if this disjunction is a right value satisfying the given predicate.

  17. def filter(p: (B) ⇒ Boolean)(implicit M: Monoid[A], F: Monad[F]): EitherT[F, A, B]

    Filter on the right of this disjunction.

  18. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  19. def flatMap[C](f: (B) ⇒ EitherT[F, A, C])(implicit F: Monad[F]): EitherT[F, A, C]

    Bind through the right of this disjunction.

  20. def flatMapF[C](f: (B) ⇒ F[\/[A, C]])(implicit F: Monad[F]): EitherT[F, A, C]

    Bind the inner monad through the right of this disjunction.

  21. def fold[X](l: (A) ⇒ X, r: (B) ⇒ X)(implicit F: Functor[F]): F[X]
  22. def foldM[X](l: (A) ⇒ F[X], r: (B) ⇒ F[X])(implicit F: Bind[F]): F[X]
  23. def foldRight[Z](z: ⇒ Z)(f: (B, ⇒ Z) ⇒ Z)(implicit F: Foldable[F]): Z

    Fold on the right of this disjunction.

  24. def forall(f: (B) ⇒ Boolean)(implicit F: Functor[F]): F[Boolean]

    Return true if this disjunction is a left value or the right value satisfies the given predicate.

  25. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  26. def getOrElse(default: ⇒ B)(implicit F: Functor[F]): F[B]

    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 |

  27. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  28. def isLeft(implicit F: Functor[F]): F[Boolean]

    Return true if this disjunction is left.

  29. def isRight(implicit F: Functor[F]): F[Boolean]

    Return true if this disjunction is right.

  30. def leftMap[C](f: (A) ⇒ C)(implicit F: Functor[F]): EitherT[F, C, B]

    Run the given function on the left value.

  31. def map[C](f: (B) ⇒ C)(implicit F: Functor[F]): EitherT[F, A, C]

    Map on the right of this disjunction.

  32. def mapT[G[_], C, D](f: (F[\/[A, B]]) ⇒ G[\/[C, D]]): EitherT[G, C, D]
  33. def merge[AA >: A](implicit F: Functor[F], ev: <~<[B, AA]): F[AA]

    Return the value from whichever side of the disjunction is defined, given a commonly assignable type.

  34. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  35. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  36. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  37. def orElse(x: ⇒ EitherT[F, A, B])(implicit F: Monad[F]): EitherT[F, A, B]

    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 |||

  38. val run: F[\/[A, B]]
  39. def show(implicit SA: Show[A], SB: Show[B], F: Functor[F]): F[Cord]

    Show for a disjunction value.

  40. def swap(implicit F: Functor[F]): EitherT[F, B, A]

    Flip the left/right values in this disjunction.

    Flip the left/right values in this disjunction. Alias for swap

  41. def swapped[AA, BB](k: (\/[B, A]) ⇒ \/[BB, AA])(implicit F: Functor[F]): EitherT[F, AA, BB]

    Run the given function on this swapped value.

    Run the given function on this swapped value. Alias for ~

  42. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  43. def toEither(implicit F: Functor[F]): F[Either[A, B]]

    Convert to a core scala.Either at your own peril.

  44. def toList(implicit F: Functor[F]): F[List[B]]

    Return an empty list or list with one element on the right of this disjunction.

  45. def toMaybe(implicit F: Functor[F]): MaybeT[F, 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.

  46. def toOption(implicit F: Functor[F]): OptionT[F, 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.

  47. def toStream(implicit F: Functor[F]): F[Stream[B]]

    Return an empty stream or stream with one element on the right of this disjunction.

  48. def toThese(implicit F: Functor[F]): TheseT[F, A, B]

    Return a this on the left-side or a that on the right-side of this disjunction

  49. def traverse[G[_], C](f: (B) ⇒ G[C])(implicit F: Traverse[F], G: Applicative[G]): G[EitherT[F, A, C]]

    Traverse on the right of this disjunction.

  50. def unary_~(implicit F: Functor[F]): EitherT[F, B, A]

    Flip the left/right values in this disjunction.

    Flip the left/right values in this disjunction. Alias for unary_~

  51. def validation(implicit F: Functor[F]): F[Validation[A, B]]

    Convert to a validation.

  52. def validationed[AA, BB](k: (Validation[A, B]) ⇒ Validation[AA, BB])(implicit F: Functor[F]): EitherT[F, AA, BB]

    Run a validation function and back to disjunction again.

  53. def valueOr(x: (A) ⇒ B)(implicit F: Functor[F]): F[B]

    Return the right value of this disjunction or run the given function on the left.

  54. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  55. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  56. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws(classOf[java.lang.InterruptedException])
  57. def withFilter(p: (B) ⇒ Boolean)(implicit M: Monoid[A], F: Monad[F]): EitherT[F, A, B]

    Alias for filter.

  58. def |(default: ⇒ B)(implicit F: Functor[F]): F[B]

    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

  59. def |||(x: ⇒ EitherT[F, A, B])(implicit F: Monad[F]): EitherT[F, A, B]

    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

  60. def ~[AA, BB](k: (\/[B, A]) ⇒ \/[BB, AA])(implicit F: Functor[F]): EitherT[F, AA, BB]

    Run the given function on this swapped value.

    Run the given function on this swapped value. Alias for swapped

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped