Packages

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

Represents a function A => F[B].

Self Type
Kleisli[F, A, B]
Source
Kleisli.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Kleisli
  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 Kleisli(run: (A) ⇒ F[B])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def andThen[C](k: Kleisli[F, B, C])(implicit F: FlatMap[F]): Kleisli[F, A, C]

    Tip to tail Kleisli arrow composition.

    Tip to tail Kleisli arrow composition. Creates a function A => F[C] from run (A => F[B]) and the given Kleisli of B => F[C].

    scala> import cats.data.Kleisli, cats.implicits._
    scala> val takeHead = Kleisli[Option, List[Int], Int](_.headOption)
    scala> val plusOne = Kleisli[Option, Int, Int](i => Some(i + 1))
    scala> (takeHead andThen plusOne).run(List(1))
    res0: Option[Int] = Some(2)
  5. def andThen[C](f: (B) ⇒ F[C])(implicit F: FlatMap[F]): Kleisli[F, A, C]

    Composes run with a function B => F[C] not lifted into Kleisli.

  6. def ap[C, D, AA <: A](f: Kleisli[F, AA, C])(implicit F: Apply[F], ev: As[B, (C) ⇒ D]): Kleisli[F, AA, D]
  7. def apply(a: A): F[B]
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @IntrinsicCandidate()
  10. def compose[Z, AA <: A](k: Kleisli[F, Z, AA])(implicit F: FlatMap[F]): Kleisli[F, Z, B]
  11. def compose[Z, AA <: A](f: (Z) ⇒ F[AA])(implicit F: FlatMap[F]): Kleisli[F, Z, B]
  12. def dimap[C, D](f: (C) ⇒ A)(g: (B) ⇒ D)(implicit F: Functor[F]): Kleisli[F, C, D]

    Performs local and map simultaneously.

  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def first[C](implicit F: Functor[F]): Kleisli[F, (A, C), (B, C)]
  15. def flatMap[C, AA <: A](f: (B) ⇒ Kleisli[F, AA, C])(implicit F: FlatMap[F]): Kleisli[F, AA, C]
  16. def flatMapF[C](f: (B) ⇒ F[C])(implicit F: FlatMap[F]): Kleisli[F, A, C]
  17. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. def lift[G[_]](implicit G: Applicative[G]): Kleisli[[α]G[F[α]], A, B]
  20. def local[AA](f: (AA) ⇒ A): Kleisli[F, AA, B]

    Contramap the input using f, where f may modify the input type of the Kleisli arrow.

    Contramap the input using f, where f may modify the input type of the Kleisli arrow.

    scala> import cats.data.Kleisli, cats.implicits._
    scala> type ParseResult[A] = Either[Throwable, A]
    scala> val parseInt = Kleisli[ParseResult, String, Int](s => Either.catchNonFatal(s.toInt))
    scala> parseInt.local[List[String]](_.combineAll).run(List("1", "2"))
    res0: ParseResult[Int] = Right(12)
  21. def lower(implicit F: Applicative[F]): Kleisli[F, A, F[B]]
  22. def map[C](f: (B) ⇒ C)(implicit F: Functor[F]): Kleisli[F, A, C]

    Modify the output of the Kleisli function with f.

    Modify the output of the Kleisli function with f.

    scala> import cats.data.Kleisli, cats.implicits._
    scala> val takeHead = Kleisli[Option, List[Int], Int](_.headOption)
    scala> takeHead.map(_.toDouble).run(List(1))
    res0: Option[Double] = Some(1.0)
  23. def mapF[N[_], C](f: (F[B]) ⇒ N[C]): Kleisli[N, A, C]
  24. def mapK[G[_]](f: ~>[F, G]): Kleisli[G, A, B]

    Modify the context F using transformation f.

  25. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  27. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  28. val run: (A) ⇒ F[B]
  29. def second[C](implicit F: Functor[F]): Kleisli[F, (C, A), (C, B)]
  30. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  31. def tap[AA <: A](implicit F: Functor[F]): Kleisli[F, AA, AA]

    Discard computed B and yield the input value.

  32. def tapWith[C, AA <: A](f: (AA, B) ⇒ C)(implicit F: Functor[F]): Kleisli[F, AA, C]

    Yield computed B combined with input value.

  33. def tapWithF[C, AA <: A](f: (AA, B) ⇒ F[C])(implicit F: FlatMap[F]): Kleisli[F, AA, C]
  34. def toReader: Reader[A, F[B]]
  35. def traverse[G[_], AA <: A](f: G[AA])(implicit F: Applicative[F], G: Traverse[G]): F[G[B]]
  36. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  38. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped