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
contramap on the first type parameter
map on the second type parameter
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.