IsCovariant

trait IsCovariant[F[_]]

Type constructors that are covariant with respect to subtyping.

A type constructor F[_] admits an instance IsCovariant[F] iff F[A] is a subtype of F[B] whenever A is a subtype of B.

The Scala language represents this natively using the [+A] notation on type constructors. The factory scalaCovariant provides an instance of this typeclass for any such type. However, type constructors which behave covariantly despite not being thus notated can also implement this typeclass. The factory force constructs an instance of IsCovariant for any type, based on the programmer's assertion that it is indeed covariant.

Note the relationship between this typeclass and Functor: whereas Functor instances are covariant functors in the "category" of Scala types and functions, instances of this typeclass are covariant functors in the "category" of Scala types and subtyping relations.

Companion
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def liftLiskovCo[A, B](implicit ev: Liskov[A, B]): Liskov[F[A], F[B]]

Concrete methods

def substCo[G[_], A, B](g: G[F[A]])(implicit ev: Liskov[A, B]): G[F[B]]
def substCt[G[_], A, B](g: G[F[B]])(implicit ev: Liskov[A, B]): G[F[A]]
def widen[A, B](fa: F[A])(implicit ev: Liskov[A, B]): F[B]

Concrete fields