trait Bifunctor[F[_, _]] extends Serializable
A type class of types which give rise to two independent, covariant functors.
- Self Type
- Bifunctor[F]
Linear Supertypes
Known Subclasses
Ordering
- Alphabetic
- By Inheritance
Inherited
- Bifunctor
- Serializable
- Serializable
- Any
- Hide All
- Show All
Visibility
- Public
- All
Abstract Value Members
-
abstract
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.implicits._ scala> val x: (List[String], Int) = (List("foo", "bar"), 3) scala> x.bimap(_.headOption, _.toLong + 1) res0: (Option[String], Long) = (Some(foo),4)
-
abstract
def
getClass(): Class[_]
- Definition Classes
- Any
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
compose[G[_, _]](implicit G0: Bifunctor[G]): Bifunctor[[α, β]F[G[α, β], G[α, β]]]
The composition of two Bifunctors is itself a Bifunctor
-
def
equals(arg0: Any): Boolean
- Definition Classes
- Any
-
def
hashCode(): Int
- Definition Classes
- Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def leftFunctor[X]: Functor[[α$1$]F[α$1$, X]]
-
def
leftMap[A, B, C](fab: F[A, B])(f: (A) ⇒ C): F[C, B]
apply a function to the "left" functor
-
def
leftWiden[A, B, AA >: A](fab: F[A, B]): F[AA, B]
Widens A into a supertype AA.
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
- def rightFunctor[X]: Functor[[β$0$]F[X, β$0$]]
-
def
toString(): String
- Definition Classes
- Any