Bind

tofu.control.Bind
See theBind companion object
trait Bind[F[_, _]] extends TwinMonad[F]

Attributes

Companion
object
Graph
Supertypes
trait TwinMonad[F]
trait Bifunctor[F]
trait Serializable
trait BiMonad[F, F]
class Object
trait Matchable
class Any
Show all
Known subtypes
trait StackSafeBind[F]
Self type
Bind[F]

Members list

Value members

Abstract methods

def foldRec[E, A, X, B](init: Either[E, A])(step: (Either[E, A]) => F[Either[E, X], Either[A, B]]): F[X, B]

Concrete methods

def lmonad[R]: Monad[F]
def monad[E]: Monad[[_] =>> F[E, _$21]]
def tailRecHandle[R, A, B](a: A)(f: A => F[Either[A, B], R]): F[B, R]
def tailRecMap[E, A, B](a: A)(f: A => F[E, Either[A, B]]): F[E, B]

Inherited methods

def as[E, A, B](fa: F[E, A])(b: => B): F[E, B]

Attributes

Inherited from:
TwinMonad
def bifunctor: Bifunctor[F]

Attributes

Inherited from:
TwinMonad
def bimap[A, B, C, D](fab: F[A, B])(f: A => C, g: B => D): F[C, D]

The quintessential method of the Bifunctor trait, it applies a function to each "side" of the bifunctor.

The quintessential method of the Bifunctor trait, it applies a function to each "side" of the bifunctor.

Example:

scala> import cats.syntax.all._

scala> val x: (List[String], Int) = (List("foo", "bar"), 3)
scala> x.bimap(_.headOption, _.toLong + 1)
res0: (Option[String], Long) = (Some(foo),4)

Attributes

Inherited from:
TwinMonad
def compose[G[_, _]](implicit G0: Bifunctor[G]): Bifunctor[[α, β] =>> F[G[α, β], G[α, β]]]

The composition of two Bifunctors is itself a Bifunctor

The composition of two Bifunctors is itself a Bifunctor

Attributes

Inherited from:
Bifunctor
def errAs[E, A, X](fa: F[E, A])(x: => X): F[X, A]

Attributes

Inherited from:
TwinMonad
def fail[E, A, B](fa: F[E, A])(f: A => E): F[E, B]

Attributes

Inherited from:
TwinMonad
def flatMap[E, A, B](fa: F[E, A], f: A => F[E, B]): F[E, B]

Attributes

Inherited from:
TwinMonad
def flatMapErr[E, A, X](fa: F[E, A], f: E => F[X, A]): F[X, A]

Attributes

Inherited from:
TwinMonad
def flatTap[E, A, B](fa: F[E, A], f: A => F[E, B]): F[E, A]

Attributes

Inherited from:
TwinMonad
def fold[E, A, X, R](fa: F[E, A])(h: E => R, f: A => R): F[X, R]

Attributes

Inherited from:
TwinMonad
def foldWith[E, A, X, R](fa: F[E, A])(h: E => F[X, R], f: A => F[X, R]): F[X, R]

Attributes

Inherited from:
TwinMonad
def foldWithC[E, A, X, R](fa: F[E, A])(h: E => F[X, R])(f: A => F[X, R]): F[X, R]

Attributes

Inherited from:
TwinMonad
def fromEither[E, A](ea: Either[E, A]): F[E, A]

Attributes

Inherited from:
TwinMonad
def handle[E, X, A](fa: F[E, A], h: E => A): F[X, A]

Attributes

Inherited from:
TwinMonad
def handleTap[E, X, A](fa: F[E, A], f: E => F[X, A]): F[E, A]

Attributes

Inherited from:
TwinMonad
def handleWith[E, X, A](fa: F[E, A], h: E => F[X, A]): F[X, A]

Attributes

Inherited from:
TwinMonad
def left[A, B](a: A): F[A, B]

Attributes

Inherited from:
TwinMonad
override def leftBifunctor: Bifunctor[F]

Attributes

Definition Classes
Inherited from:
TwinMonad
def leftFlatMap[A, B, C, D](lab: F[A, B])(fl: A => F[C, D], fr: B => F[C, D]): F[C, D]

Attributes

Inherited from:
TwinMonad
def leftFunctor[X]: Functor[F]

Attributes

Inherited from:
Bifunctor
def leftLiftTo[A, B, C[_]](fab: F[A, B])(implicit C: Applicative[C]): F[C[A], B]

Lift left into F using Applicative.

Lift left into F using Applicative.

  • Example:
scala> import cats.implicits._
scala> val x0: Either[String, Int] = Either.left("foo")
scala> val x1: Either[List[String], Int] = x0.leftLiftTo[List]

Attributes

Inherited from:
Bifunctor
def leftMap[A, B, C](fab: F[A, B])(f: A => C): F[C, B]

apply a function to the "left" functor

apply a function to the "left" functor

Attributes

Inherited from:
Bifunctor
def leftWiden[A, B, AA >: A](fab: F[A, B]): F[AA, B]

Widens A into a supertype AA. Example:

Widens A into a supertype AA. Example:

scala> import cats.syntax.all._
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

Attributes

Inherited from:
Bifunctor
def map[E, A, B](fa: F[E, A])(f: A => B): F[E, B]

Attributes

Inherited from:
TwinMonad
def mapErr[E, A, X](fa: F[E, A])(f: E => X): F[X, A]

Attributes

Inherited from:
TwinMonad
def pure[E, A](a: A): F[E, A]

Attributes

Inherited from:
TwinMonad
def raise[E, A](e: E): F[E, A]

Attributes

Inherited from:
TwinMonad
def replace[E, A, X, B](fa: F[E, A])(b: => B): F[X, B]

Attributes

Inherited from:
TwinMonad
def replaceBoth[E, A, X, B](fa: F[E, A])(x: => X)(b: => B): F[X, B]

Attributes

Inherited from:
TwinMonad
def replaceErr[E, A, X, B](fa: F[E, A])(x: => X): F[X, B]

Attributes

Inherited from:
TwinMonad
def right[A, B](b: B): F[A, B]

Attributes

Inherited from:
TwinMonad
override def rightBifunctor: Bifunctor[F]

Attributes

Definition Classes
Inherited from:
TwinMonad
def rightFlatMap[A, B, C, D](rab: F[A, B])(fl: A => F[C, D], fr: B => F[C, D]): F[C, D]

Attributes

Inherited from:
TwinMonad
def rightFunctor[X]: Functor[[_] =>> F[X, _$3]]

Attributes

Inherited from:
Bifunctor
def swap[E, A](fab: F[E, A]): F[A, E]

Attributes

Inherited from:
TwinMonad
def swapMap[E, A, X, B](fab: F[E, A])(f: E => B, g: A => X): F[X, B]

Attributes

Inherited from:
TwinMonad
def tapBoth[E, A, X, B, Y, C](fa: F[E, A])(h: E => F[X, B], f: A => F[Y, C]): F[E, A]

Attributes

Inherited from:
TwinMonad
def tapError[E, X, A, B](fa: F[E, A], f: E => F[X, B]): F[E, A]

Attributes

Inherited from:
TwinMonad
def tryTap[E, X, A, B](fa: F[E, A], f: A => F[X, B]): F[E, A]

Attributes

Inherited from:
TwinMonad
def void[E, A](fa: F[E, A]): F[E, Unit]

Attributes

Inherited from:
TwinMonad
def voidErr[E, A](fa: F[E, A]): F[Unit, A]

Attributes

Inherited from:
TwinMonad