Class/Object

cats.data

Cokleisli

Related Docs: object Cokleisli | package data

Permalink

final case class Cokleisli[F[_], A, B](run: (F[A]) ⇒ B) extends Product with Serializable

Represents a function F[A] => B.

Self Type
Cokleisli[F, A, B]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Cokleisli
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Cokleisli(run: (F[A]) ⇒ B)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def andThen[C](c: Cokleisli[F, B, C])(implicit F: CoflatMap[F]): Cokleisli[F, A, C]

    Permalink
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def compose[C](c: Cokleisli[F, C, A])(implicit F: CoflatMap[F]): Cokleisli[F, C, B]

    Permalink
  8. def contramapValue[C](f: (F[C]) ⇒ F[A]): Cokleisli[F, C, B]

    Permalink

    Example:

    Example:

    scala> import cats._, data._
    scala> val sum = Cokleisli((xs: NonEmptyList[Int]) => xs.reduceLeft(_ + _))
    
    scala> sum.contramapValue((xs: NonEmptyList[String]) => xs.map(_.toInt)).run(NonEmptyList.of("1","2","3"))
    res4: Int = 6
  9. def dimap[C, D](f: (C) ⇒ A)(g: (B) ⇒ D)(implicit F: Functor[F]): Cokleisli[F, C, D]

    Permalink

    Example:

    Example:

    scala> import cats._, data._
    scala> val f = Cokleisli((xs: NonEmptyList[Int]) => xs.reverse.head)
    scala> def before(x: Double) = x.toInt
    scala> def after(x: Int) = x.toString
    scala> f.dimap(before)(after).run(NonEmptyList.of(1.0,2.0))
    res0: String = 2
  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def first[C](implicit F: Comonad[F]): Cokleisli[F, (A, C), (B, C)]

    Permalink
  13. def flatMap[C](f: (B) ⇒ Cokleisli[F, A, C]): Cokleisli[F, A, C]

    Permalink
  14. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. def lmap[C](f: (C) ⇒ A)(implicit F: Functor[F]): Cokleisli[F, C, B]

    Permalink

    Example:

    Example:

    scala> import cats._, data._, implicits._
    scala> val f = Cokleisli((xs: NonEmptyList[Int]) => xs.reverse.head)
    scala> def before(x: Double) = x.toInt
    scala> def after(x: Int) = x.toString
    scala> f.lmap(before).rmap(after).run(NonEmptyList.of(1.0,2.0))
    res0: String = 2
  17. def map[C](f: (B) ⇒ C): Cokleisli[F, A, C]

    Permalink
  18. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. val run: (F[A]) ⇒ B

    Permalink
  22. def second[C](implicit F: Comonad[F]): Cokleisli[F, (C, A), (C, B)]

    Permalink
  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  24. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped