BinestedBitraverse

sealed abstract class BinestedBitraverse[F[_, _], G[_], H[_]] extends BinestedBifoldable[F, G, H] with Bitraverse[[_, _] =>> Binested[F, G, H, _$52, _$53]]
trait Bitraverse[[_, _] =>> Binested[F, G, H, _$52, _$53]]
trait Bifunctor[[_, _] =>> Binested[F, G, H, _$52, _$53]]
trait Bifoldable[[_, _] =>> Binested[F, G, H, _$52, _$53]]
trait Serializable
class Object
trait Matchable
class Any

Value members

Concrete methods

def bitraverse[I[_], A, B, C, D](fab: Binested[F, G, H, A, B])(f: A => I[C], g: B => I[D])(I: Applicative[I]): I[Binested[F, G, H, C, D]]

Inherited methods

def bifold[A, B](fab: Binested[F, G, H, A, B])(A: Monoid[A], B: Monoid[B]): (A, B)
Inherited from
Bifoldable
def bifoldLeft[A, B, C](fab: Binested[F, G, H, A, B], c: C)(f: (C, A) => C, g: (C, B) => C): C
Inherited from
BinestedBifoldable
def bifoldMap[A, B, C](fab: Binested[F, G, H, A, B])(f: A => C, g: B => C)(C: Monoid[C]): C

Collapse the structure by mapping each element to an element of a type that has a cats.Monoid

Collapse the structure by mapping each element to an element of a type that has a cats.Monoid

Inherited from
Bifoldable
def bifoldRight[A, B, C](fab: Binested[F, G, H, A, B], c: Eval[C])(f: (A, Eval[C]) => Eval[C], g: (B, Eval[C]) => Eval[C]): Eval[C]
Inherited from
BinestedBifoldable
override def bimap[A, B, C, D](fab: Binested[F, G, H, A, B])(f: A => C, g: B => D): Binested[F, G, H, C, D]
Definition Classes
Inherited from
Bitraverse
def bisequence[G[_], A, B](fab: Binested[F, G, H, G[A], G[B]])(`evidence$2`: Applicative[G]): G[Binested[F, G, H, A, B]]

Invert the structure from F[G[A], G[B]] to G[F[A, B]].

Invert the structure from F[G[A], G[B]] to G[F[A, B]].

Example:

scala> import cats.implicits._

scala> val rightSome: Either[Option[String], Option[Int]] = Either.right(Some(3))
scala> rightSome.bisequence
res0: Option[Either[String, Int]] = Some(Right(3))

scala> val rightNone: Either[Option[String], Option[Int]] = Either.right(None)
scala> rightNone.bisequence
res1: Option[Either[String, Int]] = None

scala> val leftSome: Either[Option[String], Option[Int]] = Either.left(Some("foo"))
scala> leftSome.bisequence
res2: Option[Either[String, Int]] = Some(Left(foo))

scala> val leftNone: Either[Option[String], Option[Int]] = Either.left(None)
scala> leftNone.bisequence
res3: Option[Either[String, Int]] = None
Inherited from
Bitraverse
def compose[G[_, _]](ev: Bitraverse[G]): Bitraverse[[α, β] =>> Binested[F, G, H, G[α, β], G[α, β]]]

If F and G are both cats.Bitraverse then so is their composition F[G[_, _], G[_, _]]

If F and G are both cats.Bitraverse then so is their composition F[G[_, _], G[_, _]]

Inherited from
Bitraverse
def compose[G[_, _]](G0: Bifunctor[G]): Bifunctor[[α, β] =>> Binested[F, G, H, G[α, β], G[α, β]]]

The composition of two Bifunctors is itself a Bifunctor

The composition of two Bifunctors is itself a Bifunctor

Inherited from
Bifunctor
def compose[G[_, _]](ev: Bifoldable[G]): Bifoldable[[α, β] =>> Binested[F, G, H, G[α, β], G[α, β]]]
Inherited from
Bifoldable
def leftFunctor[X]: Functor[[_] =>> Binested[F, G, H, _$4, X]]
Inherited from
Bifunctor
def leftMap[A, B, C](fab: Binested[F, G, H, A, B])(f: A => C): Binested[F, G, H, C, B]

apply a function to the "left" functor

apply a function to the "left" functor

Inherited from
Bifunctor
@noop
def leftSequence[G[_], A, B](fgab: Binested[F, G, H, G[A], B])(G: Applicative[G]): G[Binested[F, G, H, A, B]]

Sequence the left side of the structure. For the right side, use the standard sequence from cats.Traverse.

Sequence the left side of the structure. For the right side, use the standard sequence from cats.Traverse.

Example:

scala> import cats.implicits._

scala> val optionalErrorRight: Either[Option[String], Int] = Either.right(123)
scala> optionalErrorRight.leftSequence
res1: Option[Either[String, Int]] = Some(Right(123))

scala> val optionalErrorLeftSome: Either[Option[String], Int] = Either.left(Some("something went wrong"))
scala> optionalErrorLeftSome.leftSequence
res2: Option[Either[String, Int]] = Some(Left(something went wrong))

scala> val optionalErrorLeftNone: Either[Option[String], Int] = Either.left(None)
scala> optionalErrorLeftNone.leftSequence
res3: Option[Either[String,Int]] = None
Inherited from
Bitraverse
@noop
def leftTraverse[G[_], A, B, C](fab: Binested[F, G, H, A, B])(f: A => G[C])(G: Applicative[G]): G[Binested[F, G, H, C, B]]

Traverse over the left side of the structure. For the right side, use the standard traverse from cats.Traverse.

Traverse over the left side of the structure. For the right side, use the standard traverse from cats.Traverse.

Example:

scala> import cats.implicits._

scala> val intAndString: (Int, String) = (7, "test")

scala> Bitraverse[Tuple2].leftTraverse(intAndString)(i => Option(i).filter(_ > 5))
res1: Option[(Int, String)] = Some((7,test))

scala> Bitraverse[Tuple2].leftTraverse(intAndString)(i => Option(i).filter(_ < 5))
res2: Option[(Int, String)] = None
Inherited from
Bitraverse
def leftWiden[A, B, AA >: A](fab: Binested[F, G, H, A, B]): Binested[F, G, H, AA, B]

Widens A into a supertype AA. Example:

Widens A into a supertype AA. Example:

scala> import cats.implicits._
scala> sealed trait Foo
scala> case object Bar extends Foo
scala> val x1: Either[Bar.type, Int] = Either.left(Bar)
scala> val x2: Either[Foo, Int] = x1.leftWiden
Inherited from
Bifunctor
def rightFunctor[X]: Functor[[_] =>> Binested[F, G, H, X, _$3]]
Inherited from
Bifunctor

Implicits

Implicits

implicit override def F: Bitraverse[F]
Definition Classes
implicit override def G: Traverse[G]
Definition Classes
implicit override def H: Traverse[H]
Definition Classes