trait
IsContravariant[F[_]] extends AnyRef
Abstract Value Members
-
abstract
def
liftLiskovCt[A, B](implicit ev: <~<[A, B]): <~<[F[B], F[A]]
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
-
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
-
final
def
isInstanceOf[T0]: Boolean
-
def
narrow[A, B](fa: F[B])(implicit ev: <~<[A, B]): F[A]
-
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
def
substCo[G[+_], A, B](g: G[F[B]])(implicit ev: <~<[A, B]): G[F[A]]
-
def
substCt[G[-_], A, B](g: G[F[A]])(implicit ev: <~<[A, B]): G[F[B]]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
Type constructors that are contravariant with respect to subtyping.
A type constructor
F[_]
admits an instanceIsContravariant[F]
iffF[B]
is a subtype ofF[A]
wheneverA
is a subtype ofB
.The Scala language represents this natively using the
[-A]
notation on type constructors. The factory scalaContravariant provides an instance of this typeclass for any such type. However, type constructors which behave contravariantly despite not being thus notated can also implement this typeclass. The factory force constructs an instance ofIsContravariant
for any type, based on the programmer's assertion that it is indeed contravariant.Note the relationship between this typeclass and Contravariant: whereas Contravariant instances are contravariant functors in the "category" of Scala types and functions, instances of this typeclass are contravariant functors in the "category" of Scala types and subtyping relations.