Packages

trait Profunctor[F[_, _]] extends Serializable

A Profunctor is a Contravariant functor on its first type parameter and a Functor on its second type parameter.

Must obey the laws defined in cats.laws.ProfunctorLaws.

Self Type
Profunctor[F]
Source
Profunctor.scala
Linear Supertypes
Serializable, Serializable, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Profunctor
  2. Serializable
  3. Serializable
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def dimap[A, B, C, D](fab: F[A, B])(f: (C) ⇒ A)(g: (B) ⇒ D): F[C, D]

    Contramap on the first type parameter and map on the second type parameter

    Contramap on the first type parameter and map on the second type parameter

    Example:

    scala> import cats.implicits._
    scala> import cats.arrow.Profunctor
    scala> val fab: Double => Double = x => x + 0.3
    scala> val f: Int => Double = x => x.toDouble / 2
    scala> val g: Double => Double = x => x * 3
    scala> val h = Profunctor[Function1].dimap(fab)(f)(g)
    scala> h(3)
    res0: Double = 5.4
  2. abstract def getClass(): Class[_]
    Definition Classes
    Any

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##(): Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def equals(arg0: Any): Boolean
    Definition Classes
    Any
  6. def hashCode(): Int
    Definition Classes
    Any
  7. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  8. def lmap[A, B, C](fab: F[A, B])(f: (C) ⇒ A): F[C, B]

    contramap on the first type parameter

  9. def rmap[A, B, C](fab: F[A, B])(f: (B) ⇒ C): F[A, C]

    map on the second type parameter

  10. def toString(): String
    Definition Classes
    Any

Inherited from Serializable

Inherited from Serializable

Inherited from Any

Ungrouped