t

scalaz

# Contravariant 

### Companion object 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.

Self Type
Contravariant[F]
Source
Contravariant.scala

scalaz.Contravariant.ContravariantLaw

Linear Supertypes
Known Subclasses
Ordering
1. Alphabetic
2. By Inheritance
Inherited
1. Contravariant
2. InvariantFunctor
3. AnyRef
4. Any
1. Hide All
2. Show All
Visibility
1. Public
2. All

### Type Members

1. trait
2. trait InvariantFunctorLaw extends AnyRef
Definition Classes
InvariantFunctor

### Abstract Value Members

1. abstract def contramap[A, B](r: F[A])(f: (B) ⇒ A): F[B]

Transform `A`.

Transform `A`.

Note

`contramap(r)(identity)` = `r`

### Concrete Value Members

1. final def !=(arg0: Any)
Definition Classes
AnyRef → Any
2. final def ##(): Int
Definition Classes
AnyRef → Any
3. final def ==(arg0: Any)
Definition Classes
AnyRef → Any
4. final def asInstanceOf[T0]: T0
Definition Classes
Any
5. def clone()
Attributes
protected[java.lang]
Definition Classes
AnyRef
Annotations
@native() @throws( ... )
6. def compose[G[_]](implicit G0: Contravariant[G]): Functor[[α]F[G[α]]]

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

7. def contravariantLaw
8. val contravariantSyntax
9. final def eq(arg0: AnyRef)
Definition Classes
AnyRef
10. def equals(arg0: Any)
Definition Classes
AnyRef → Any
11. def finalize(): Unit
Attributes
protected[java.lang]
Definition Classes
AnyRef
Annotations
@throws( classOf[java.lang.Throwable] )
12. final def getClass(): Class[_]
Definition Classes
AnyRef → Any
Annotations
@native()
13. def hashCode(): Int
Definition Classes
AnyRef → Any
Annotations
@native()
14. def icompose[G[_]](implicit G0: Functor[G]): Contravariant[[α]F[G[α]]]

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

15. def invariantFunctorLaw
Definition Classes
InvariantFunctor
16. val invariantFunctorSyntax
Definition Classes
InvariantFunctor
17. final def isInstanceOf[T0]
Definition Classes
Any
18. final def ne(arg0: AnyRef)
Definition Classes
AnyRef
19. final def notify(): Unit
Definition Classes
AnyRef
Annotations
@native()
20. final def notifyAll(): Unit
Definition Classes
AnyRef
Annotations
@native()
21. def product[G[_]](implicit G0: Contravariant[G]): Contravariant[[α](F[α], G[α])]

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

22. final def synchronized[T0](arg0: ⇒ T0): T0
Definition Classes
AnyRef
23. def toString()
Definition Classes
AnyRef → Any
24. final def wait(): Unit
Definition Classes
AnyRef
Annotations
@throws( ... )
25. final def wait(arg0: Long, arg1: Int): Unit
Definition Classes
AnyRef
Annotations
@throws( ... )
26. final def wait(arg0: Long): Unit
Definition Classes
AnyRef
Annotations
@native() @throws( ... )
27. def xmap[A, B](fa: F[A], f: (A) ⇒ B, g: (B) ⇒ A): F[B]

Converts `ma` to a value of type `F[B]` using the provided functions `f` and `g`.

Converts `ma` to a value of type `F[B]` using the provided functions `f` and `g`.

Definition Classes
ContravariantInvariantFunctor
28. 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.

Definition Classes
InvariantFunctor
29. def xmapi[A, B](ma: F[A])(iso: Isomorphism.<=>[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.

Definition Classes
InvariantFunctor