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
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](f: Kleisli[F, A, (B) ⇒ C])(implicit F: Apply[F]): Kleisli[F, A, C]
  7. def apply(a: A): F[B]
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  10. def compose[Z](k: Kleisli[F, Z, A])(implicit F: FlatMap[F]): Kleisli[F, Z, B]
  11. def compose[Z](f: (Z) ⇒ F[A])(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 finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def first[C](implicit F: Functor[F]): Kleisli[F, (A, C), (B, C)]
  16. def flatMap[C](f: (B) ⇒ Kleisli[F, A, C])(implicit F: FlatMap[F]): Kleisli[F, A, C]
  17. def flatMapF[C](f: (B) ⇒ F[C])(implicit F: FlatMap[F]): Kleisli[F, A, C]
  18. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. def lift[G[_]](implicit G: Applicative[G]): Kleisli[[α]G[F[α]], A, B]
  21. 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)
  22. def lower(implicit F: Applicative[F]): Kleisli[F, A, F[B]]
  23. 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)
  24. def mapF[N[_], C](f: (F[B]) ⇒ N[C]): Kleisli[N, A, C]
  25. def mapK[G[_]](f: ~>[F, G]): Kleisli[G, A, B]

    Modify the context F using transformation f.

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

    Discard computed B and yield the input value.

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

    Yield computed B combined with input value.

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

Deprecated Value Members

  1. def transform[G[_]](f: FunctionK[F, G]): Kleisli[G, A, B]
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0-RC2) Use mapK

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped