Trait/Object

scalaz

EitherT

Related Docs: object EitherT | package scalaz

Permalink

sealed trait EitherT[F[+_], +A, +B] extends AnyRef

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
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. EitherT
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. sealed trait Switching_\/[X] extends AnyRef

    Permalink

Abstract Value Members

  1. abstract val run: F[\/[A, B]]

    Permalink

Concrete Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +++[AA >: A, BB >: B](x: ⇒ EitherT[F, AA, BB])(implicit M1: Semigroup[BB], M2: Semigroup[AA], F: Apply[F]): EitherT[F, AA, BB]

    Permalink

    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]

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef → Any
  6. def ===[AA >: A, BB >: B](x: EitherT[F, AA, BB])(implicit EA: Equal[AA], EB: Equal[BB], F: Apply[F]): F[Boolean]

    Permalink

    Compare two disjunction values for equality.

  7. def app[AA >: A, C](f: ⇒ EitherT[F, AA, (B) ⇒ C])(implicit F: Apply[F]): EitherT[F, AA, C]

    Permalink

    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

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

    Permalink

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

    Permalink

    Binary functor traverse on this disjunction.

  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def compare[AA >: A, BB >: B](x: EitherT[F, AA, BB])(implicit EA: Order[AA], EB: Order[BB], F: Apply[F]): F[Ordering]

    Permalink

    Compare two disjunction values for ordering.

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

    Permalink

    Cozip this disjunction on its functor.

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

    Permalink

    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

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

    Permalink
    Definition Classes
    AnyRef → Any
  17. def exists(f: (B) ⇒ Boolean)(implicit F: Functor[F]): F[Boolean]

    Permalink

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

  18. def filter[AA >: A](p: (B) ⇒ Boolean)(implicit M: Monoid[AA], F: Functor[F]): EitherT[F, AA, B]

    Permalink

    Filter on the right of this disjunction.

  19. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. def flatMap[AA >: A, C](f: (B) ⇒ EitherT[F, AA, C])(implicit F: Monad[F]): EitherT[F, AA, C]

    Permalink

    Bind through the right of this disjunction.

  21. def fold[X](l: (A) ⇒ X, r: (B) ⇒ X)(implicit F: Functor[F]): F[X]

    Permalink
  22. def foldRight[Z](z: ⇒ Z)(f: (B, ⇒ Z) ⇒ Z)(implicit F: Foldable[F]): Z

    Permalink

    Fold on the right of this disjunction.

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

    Permalink

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

  24. def foreach(f: (B) ⇒ Unit)(implicit F: Each[F]): Unit

    Permalink

    Run the side-effect on the right of this disjunction.

  25. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  26. def getOrElse[BB >: B](default: ⇒ BB)(implicit F: Functor[F]): F[BB]

    Permalink

    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. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  29. def isLeft(implicit F: Functor[F]): F[Boolean]

    Permalink

    Return true if this disjunction is left.

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

    Permalink

    Return true if this disjunction is right.

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

    Permalink

    Run the given function on the left value.

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

    Permalink

    Map on the right of this disjunction.

  33. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  36. def orElse[AA >: A, BB >: B](x: ⇒ EitherT[F, AA, BB])(implicit F: Bind[F]): EitherT[F, AA, BB]

    Permalink

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

  37. def show[AA >: A, BB >: B](implicit SA: Show[AA], SB: Show[BB], F: Functor[F]): F[Cord]

    Permalink

    Show for a disjunction value.

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

    Permalink

    Flip the left/right values in this disjunction.

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

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

    Permalink

    Run the given function on this swapped value.

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

  40. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  41. def toEither(implicit F: Functor[F]): F[Either[A, B]]

    Permalink

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

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

    Permalink

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

  43. def toOption(implicit F: Functor[F]): OptionT[F, B]

    Permalink

    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.

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

    Permalink

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

  45. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  46. def traverse[G[_], AA >: A, C](f: (B) ⇒ G[C])(implicit F: Traverse[F], G: Applicative[G]): G[EitherT[F, AA, C]]

    Permalink

    Traverse on the right of this disjunction.

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

    Permalink

    Flip the left/right values in this disjunction.

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

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

    Permalink

    Convert to a validation.

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

    Permalink

    Run a validation function and back to disjunction again.

  50. def valueOr[BB >: B](x: (A) ⇒ BB)(implicit F: Functor[F]): F[BB]

    Permalink

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

  51. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. def withFilter[AA >: A](p: (B) ⇒ Boolean)(implicit M: Monoid[AA], F: Functor[F]): EitherT[F, AA, B]

    Permalink

    Alias for filter.

    Alias for filter.

    Since

    7.0.2

  55. def |[BB >: B](default: ⇒ BB)(implicit F: Functor[F]): F[BB]

    Permalink

    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

  56. def |||[AA >: A, BB >: B](x: ⇒ EitherT[F, AA, BB])(implicit F: Bind[F]): EitherT[F, AA, BB]

    Permalink

    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

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

    Permalink

    Run the given function on this swapped value.

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

Inherited from AnyRef

Inherited from Any

Ungrouped