CatsProfunctorForSubject

cats.arrow.Profunctor type class instance for Subject.

References:

trait Serializable
class Object
trait Matchable
class Any

Value members

Concrete methods

def dimap[A, B, C, D](source: Subject[A, B])(f: C => A)(g: B => D): Subject[C, D]

Inherited methods

def leftNarrow[A, B, AA <: A](fab: Subject[A, B]): Subject[AA, B]

Narrows A into a subtype AA. Example:

Narrows A into a subtype AA. Example:

scala> import cats.syntax.profunctor._
scala> import cats.instances.function._
scala>
scala> sealed trait Foo
scala> case object Bar extends Foo
scala> val x1: Foo => Int = _ => 1
scala> val x2: Bar.type => Int = x1.leftNarrow
Inherited from:
Profunctor
def lmap[A, B, C](fab: Subject[A, B])(f: C => A): Subject[C, B]

contramap on the first type parameter

contramap on the first type parameter

Inherited from:
Profunctor
def rightWiden[A, B, BB >: B](fab: Subject[A, B]): Subject[A, BB]

Widens B into a supertype BB. Example:

Widens B into a supertype BB. Example:

scala> import cats.syntax.profunctor._
scala> import cats.instances.function._
scala>
scala> sealed trait Foo
scala> case object Bar extends Foo
scala> val x1: Int => Bar.type = _ => Bar
scala> val x2: Int => Foo = x1.rightWiden
Inherited from:
Profunctor
def rmap[A, B, C](fab: Subject[A, B])(f: B => C): Subject[A, C]

map on the second type parameter

map on the second type parameter

Inherited from:
Profunctor