final case class Binested[F[_, _], G[_], H[_], A, B](value: F[G[A], H[B]]) extends Product with Serializable
Compose a two-slot type constructor F[_, _]
with two single-slot type constructors
G[_]
and H[_]
, resulting in a two-slot type constructor with respect to the inner types.
For example, List
and Option
both have Functor
instances, and Either
has a
Bifunctor
instance. Therefore, Binested[Either, List, Option, *, *]
has a Bifunctor
instance as well:
scala> import cats.Bifunctor scala> import cats.data.Binested scala> import cats.syntax.all._ scala> val eitherListOption: Either[List[Int], Option[String]] = Right(Some("cats")) scala> val f: Int => String = _.toString scala> val g: String => String = _ + "-bifunctor" scala> val binested = Binested(eitherListOption) scala> val bimapped = Bifunctor[Binested[Either, List, Option, *, *]].bimap(binested)(f, g).value res0: Either[List[String], Option[String]] = Right(Some("cats-bifunctor"))
- Source
- Binested.scala
- Alphabetic
- By Inheritance
- Binested
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Binested(value: F[G[A], H[B]])
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- val value: F[G[A], H[B]]
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()