All Downloads are FREE. Search and download functionalities are using the official Maven repository.

izumi.functional.bio.Bifunctor2.scala Maven / Gradle / Ivy

There is a newer version: 1.2.16
Show newest version
package izumi.functional.bio

import scala.annotation.unused

trait Bifunctor2[F[+_, +_]] extends RootBifunctor[F] {
  def InnerF: Functor2[F]

  def bimap[E, A, E2, A2](r: F[E, A])(f: E => E2, g: A => A2): F[E2, A2]
  def leftMap[E, A, E2](r: F[E, A])(f: E => E2): F[E2, A] = bimap(r)(f, identity)

  @inline final def widenError[E, A, E1](r: F[E, A])(implicit @unused ev: E <:< E1): F[E1, A] = r.asInstanceOf[F[E1, A]]
  @inline final def widenBoth[E, A, E1, A1](r: F[E, A])(implicit @unused ev: E <:< E1, @unused ev2: A <:< A1): F[E1, A1] =
    r.asInstanceOf[F[E1, A1]]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy