Contravariant

trait Contravariant[F[_]] extends InvariantFunctor[F]

Contravariant functors. For example, functions provide a scalaz.Functor in their result type, but a scalaz.Contravariant for each argument type.

Note that the dual of a scalaz.Functor is just a scalaz.Functor itself.

Providing an instance of this is a useful alternative to marking a type parameter with - in Scala.

See also
Companion
object
class Object
trait Matchable
class Any

Type members

Classlikes

Inherited classlikes

Value members

Abstract methods

def contramap[A, B](r: F[A])(f: B => A): F[B]

Transform A.

Transform A.

Note

contramap(r)(identity) = r

Concrete methods

def compose[G[_]](implicit G0: Contravariant[G]): Functor[[α] =>> F[G[α]]]

The composition of Contravariant F and G, [x]F[G[x]], is covariant.

The composition of Contravariant F and G, [x]F[G[x]], is covariant.

def icompose[G[_]](implicit G0: Functor[G]): Contravariant[[α] =>> F[G[α]]]

The composition of Contravariant F and Functor G, [x]F[G[x]], is contravariant.

The composition of Contravariant F and Functor G, [x]F[G[x]], is contravariant.

def narrow[A, B](fa: F[A])(implicit ev: Liskov[B, A]): F[B]
def product[G[_]](implicit G0: Contravariant[G]): Contravariant[[α] =>> (F[α], G[α])]

The product of Contravariant F and G, [x](F[x], G[x]]), is contravariant.

The product of Contravariant F and G, [x](F[x], G[x]]), is contravariant.

def xmap[A, B](fa: F[A], f: A => B, g: B => A): F[B]

Inherited methods

def xmapb[A, B](ma: F[A])(b: Bijection[A, B]): F[B]

Converts ma to a value of type F[B] using the provided bijection.

Converts ma to a value of type F[B] using the provided bijection.

Inherited from
InvariantFunctor
def xmapi[A, B](ma: F[A])(iso: IsoSet[A, B]): F[B]

Converts ma to a value of type F[B] using the provided isomorphism.

Converts ma to a value of type F[B] using the provided isomorphism.

Inherited from
InvariantFunctor

Inherited fields