object Kleisli extends KleisliInstances with KleisliFunctions with KleisliFunctionsBinCompat with KleisliExplicitInstances with Serializable

Source
Kleisli.scala
Linear Supertypes
Serializable, Serializable, KleisliExplicitInstances, KleisliFunctionsBinCompat, KleisliFunctions, KleisliInstances, KleisliInstances0, KleisliInstances0_5, KleisliInstances1, KleisliInstances2, KleisliInstances3, KleisliInstances4, KleisliInstances5, KleisliInstances6, KleisliInstances7, KleisliInstances8, KleisliInstances9, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Kleisli
  2. Serializable
  3. Serializable
  4. KleisliExplicitInstances
  5. KleisliFunctionsBinCompat
  6. KleisliFunctions
  7. KleisliInstances
  8. KleisliInstances0
  9. KleisliInstances0_5
  10. KleisliInstances1
  11. KleisliInstances2
  12. KleisliInstances3
  13. KleisliInstances4
  14. KleisliInstances5
  15. KleisliInstances6
  16. KleisliInstances7
  17. KleisliInstances8
  18. KleisliInstances9
  19. AnyRef
  20. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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 applyK[F[_], A](a: A): ~>[[γ$0$]Kleisli[F, A, γ$0$], F]

    Creates a FunctionK that transforms a Kleisli[F, A, B] into an F[B] by applying the value of type a:A.

    Creates a FunctionK that transforms a Kleisli[F, A, B] into an F[B] by applying the value of type a:A.

    scala> import cats.{~>}, cats.data.{Kleisli, EitherT}
    
    scala> def f(i: Int): Option[Either[Char, Char]] = if (i > 0) Some(Right('n')) else if (i < 0) Some(Left('z')) else None
    
    scala> type KOI[A] = Kleisli[Option, Int, A]
    scala> val b: KOI[Either[Char, Char]] = Kleisli[Option, Int, Either[Char, Char]](f _)
    scala> val nt: Kleisli[Option, Int, ?] ~> Option = Kleisli.applyK[Option, Int](1)
    scala> nt(b)
    res0: Option[Either[Char, Char]] = Some(Right(n))
    
    scala> type EKOIC[A] = EitherT[KOI, Char, A]
    scala> val c: EKOIC[Char] = EitherT[KOI, Char, Char](b)
    scala> c.mapK(nt).value
    res1: Option[Either[Char, Char]] = Some(Right(n))
    
    scala> val ntz = Kleisli.applyK[Option, Int](0)
    scala> c.mapK(ntz).value
    res2: Option[Either[Char, Char]] = None
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def ask[F[_], A](implicit F: Applicative[F]): Kleisli[F, A, A]

    Creates a Kleisli arrow which can lift an A into applicative context F.

    Creates a Kleisli arrow which can lift an A into applicative context F. This is distinct from pure in that the input is what is lifted (and not ignored).

    scala> Kleisli.ask[Option, Int].run(1)
    res0: Option[Int]: Some(1)
    Definition Classes
    KleisliFunctions
  7. implicit def catsDataAlternativeForKleisli[F[_], A](implicit F0: Alternative[F]): Alternative[[γ$54$]Kleisli[F, A, γ$54$]]
    Definition Classes
    KleisliInstances2
  8. implicit def catsDataApplicativeErrorForKleisli[F[_], E, A](implicit F0: ApplicativeError[F, E]): ApplicativeError[[γ$68$]Kleisli[F, A, γ$68$], E]
    Definition Classes
    KleisliInstances5
  9. implicit def catsDataApplicativeForKleisli[F[_], A](implicit A: Applicative[F]): Applicative[[γ$69$]Kleisli[F, A, γ$69$]]
    Definition Classes
    KleisliInstances6
  10. implicit def catsDataApplyForKleisli[F[_], A](implicit A: Apply[F]): Apply[[γ$70$]Kleisli[F, A, γ$70$]]
    Definition Classes
    KleisliInstances7
  11. implicit def catsDataArrowChoiceForKleisli[F[_]](implicit M: Monad[F]): ArrowChoice[[β$28$, γ$29$]Kleisli[F, β$28$, γ$29$]]
    Definition Classes
    KleisliInstances0_5
  12. implicit def catsDataChoiceForKleisli[F[_]](implicit M: Monad[F]): Choice[[β$58$, γ$59$]Kleisli[F, β$58$, γ$59$]]
    Definition Classes
    KleisliInstances3
  13. implicit val catsDataChoiceForKleisliId: Choice[[β$60$, γ$61$]Kleisli[[A]A, β$60$, γ$61$]]
    Definition Classes
    KleisliInstances3
  14. implicit def catsDataCommutativeArrowForKleisli[F[_]](implicit M: CommutativeMonad[F]): CommutativeArrow[[β$21$, γ$22$]Kleisli[F, β$21$, γ$22$]] with ArrowChoice[[β$23$, γ$24$]Kleisli[F, β$23$, γ$24$]]
    Definition Classes
    KleisliInstances0
  15. implicit val catsDataCommutativeArrowForKleisliId: CommutativeArrow[[β$16$, γ$17$]Kleisli[[A]A, β$16$, γ$17$]]
    Definition Classes
    KleisliInstances
  16. implicit def catsDataCommutativeFlatMapForKleisli[F[_], A](implicit F0: CommutativeFlatMap[F]): CommutativeFlatMap[[γ$56$]Kleisli[F, A, γ$56$]]
    Definition Classes
    KleisliInstances3
  17. implicit def catsDataCommutativeMonadForKleisli[F[_], A](implicit F0: CommutativeMonad[F]): CommutativeMonad[[γ$25$]Kleisli[F, A, γ$25$]]
    Definition Classes
    KleisliInstances0
  18. implicit def catsDataComposeForKleisli[F[_]](implicit FM: FlatMap[F]): Compose[[β$62$, γ$63$]Kleisli[F, β$62$, γ$63$]]
    Definition Classes
    KleisliInstances3
  19. implicit def catsDataContravariantForKleisli[F[_], C]: Contravariant[[β$52$]Kleisli[F, β$52$, C]]
    Definition Classes
    KleisliInstances1
  20. implicit def catsDataContravariantMonoidalForKleisli[F[_], A](implicit F0: ContravariantMonoidal[F]): ContravariantMonoidal[[γ$30$]Kleisli[F, A, γ$30$]]
    Definition Classes
    KleisliInstances0_5
  21. implicit def catsDataDeferForKleisli[F[_], A](implicit F: Defer[F]): Defer[[γ$18$]Kleisli[F, A, γ$18$]]
    Definition Classes
    KleisliInstances
  22. implicit def catsDataDistributiveForKleisli[F[_], R](implicit F0: Distributive[F]): Distributive[[γ$71$]Kleisli[F, R, γ$71$]]
    Definition Classes
    KleisliInstances8
  23. implicit def catsDataFlatMapForKleisli[F[_], A](implicit FM: FlatMap[F]): FlatMap[[γ$67$]Kleisli[F, A, γ$67$]]
    Definition Classes
    KleisliInstances4
  24. implicit def catsDataFunctorFilterForKleisli[F[_], A](implicit ev: FunctorFilter[F]): FunctorFilter[[γ$20$]Kleisli[F, A, γ$20$]]
    Definition Classes
    KleisliInstances
  25. implicit def catsDataFunctorForKleisli[F[_], A](implicit F0: Functor[F]): Functor[[γ$72$]Kleisli[F, A, γ$72$]]
    Definition Classes
    KleisliInstances9
  26. implicit def catsDataMonadErrorForKleisli[F[_], A, E](implicit ME: MonadError[F, E]): MonadError[[γ$27$]Kleisli[F, A, γ$27$], E]
    Definition Classes
    KleisliInstances0_5
  27. implicit def catsDataMonadForKleisli[F[_], A](implicit M: Monad[F]): Monad[[γ$35$]Kleisli[F, A, γ$35$]]
    Definition Classes
    KleisliInstances1
  28. implicit def catsDataMonadForKleisliId[A]: CommutativeMonad[[γ$15$]Kleisli[[A]A, A, γ$15$]]
    Definition Classes
    KleisliInstances
  29. implicit def catsDataMonoidForKleisli[F[_], A, B](implicit FB0: Monoid[F[B]]): Monoid[Kleisli[F, A, B]]
    Definition Classes
    KleisliInstances0_5
  30. implicit def catsDataMonoidKForKleisli[F[_], A](implicit F0: MonoidK[F]): MonoidK[[γ$55$]Kleisli[F, A, γ$55$]]
    Definition Classes
    KleisliInstances3
  31. implicit def catsDataParallelForKleisli[F[_], M[_], A](implicit P: Parallel[M, F]): Parallel[[γ$36$]Kleisli[M, A, γ$36$], [γ$37$]Kleisli[F, A, γ$37$]]
    Definition Classes
    KleisliInstances1
  32. implicit def catsDataRepresentableForKleisli[M[_], R, E](implicit R: Aux[M, R], FK: Functor[[γ$31$]Kleisli[M, E, γ$31$]]): Aux[[γ$32$]Kleisli[M, E, γ$32$], (E, R)]

    Witness for: Kleisli[M, E, A] <-> (E, R) => A if M is Representable

    Witness for: Kleisli[M, E, A] <-> (E, R) => A if M is Representable

    Definition Classes
    KleisliInstances0_5
  33. implicit def catsDataSemigroupForKleisli[F[_], A, B](implicit FB0: Semigroup[F[B]]): Semigroup[Kleisli[F, A, B]]
    Definition Classes
    KleisliInstances3
  34. implicit def catsDataSemigroupKForKleisli[F[_], A](implicit F0: SemigroupK[F]): SemigroupK[[γ$66$]Kleisli[F, A, γ$66$]]
    Definition Classes
    KleisliInstances4
  35. implicit def catsDataStrongForKleisli[F[_]](implicit F0: Functor[F]): Strong[[β$64$, γ$65$]Kleisli[F, β$64$, γ$65$]]
    Definition Classes
    KleisliInstances3
  36. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  37. def endoMonoidK[F[_]](implicit M: Monad[F]): MonoidK[[α]Kleisli[F, α, α]]
    Definition Classes
    KleisliExplicitInstances
  38. def endoSemigroupK[F[_]](implicit FM: FlatMap[F]): SemigroupK[[α]Kleisli[F, α, α]]
    Definition Classes
    KleisliExplicitInstances
  39. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  40. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  41. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  42. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  43. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  44. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  45. def liftF[F[_], A, B](x: F[B]): Kleisli[F, A, B]

    Creates a Kleisli that ignores its input A and returns the given F[B].

    Creates a Kleisli that ignores its input A and returns the given F[B].

    scala> import cats.data.Kleisli, cats.implicits._
    scala> val takeHead = Kleisli((_:List[Int]).headOption)
    scala> val makeList = Kleisli.liftF[Option, Unit, List[Int]](Some(List(1,2,3)))
    scala> (makeList andThen takeHead).run(())
    res0: Option[Int] = Some(1)
    Definition Classes
    KleisliFunctions
  46. def liftFunctionK[F[_], G[_], A](f: ~>[F, G]): ~>[[γ$6$]Kleisli[F, A, γ$6$], [γ$7$]Kleisli[G, A, γ$7$]]

    Lifts a natural transformation of effects within a Kleisli to a transformation of Kleislis.

    Lifts a natural transformation of effects within a Kleisli to a transformation of Kleislis.

    Equivalent to running mapK(f) on a Kleisli.

    scala> import cats._, data._
    scala> val f: (List ~> Option) = λ[List ~> Option](_.headOption)
    
    scala> val k: Kleisli[List, String, Char] = Kleisli(_.toList)
    scala> k.run("foo")
    res0: List[Char] = List(f, o, o)
    
    scala> val k2: Kleisli[Option, String, Char] = Kleisli.liftFunctionK(f)(k)
    scala> k2.run("foo")
    res1: Option[Char] = Some(f)
    Definition Classes
    KleisliFunctionsBinCompat
  47. def liftK[F[_], A]: ~>[F, [γ$3$]Kleisli[F, A, γ$3$]]

    Same as liftF, but expressed as a FunctionK for use with mapK

    Same as liftF, but expressed as a FunctionK for use with mapK

    scala> import cats._, data._, implicits._
    scala> val a: OptionT[Eval, Int] = 1.pure[OptionT[Eval, ?]]
    scala> val b: OptionT[Kleisli[Eval, String, ?], Int] = a.mapK(Kleisli.liftK)
    scala> b.value.run("").value
    res0: Option[Int] = Some(1)
    Definition Classes
    KleisliFunctions
  48. def local[M[_], A, R](f: (R) ⇒ R)(fa: Kleisli[M, R, A]): Kleisli[M, R, A]

    Modifies the input environment with f, without changing the input type of the Kleisli.

    Modifies the input environment with f, without changing the input type of the Kleisli.

    scala> import cats.data.Kleisli
    scala> val takeHead = Kleisli[Option, List[Int], Int](_.headOption)
    scala> Kleisli.local[Option, Int, List[Int]](1 :: _)(takeHead).run(List(2,3))
    res0: Option[Int] = Some(1)
    Definition Classes
    KleisliFunctions
  49. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  50. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  51. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  52. def pure[F[_], A, B](x: B)(implicit F: Applicative[F]): Kleisli[F, A, B]

    Creates a Kleisli arrow ignoring its input and lifting the given B into applicative context F.

    Creates a Kleisli arrow ignoring its input and lifting the given B into applicative context F.

    scala> import cats.data.Kleisli, cats.implicits._
    scala> val pureOpt = Kleisli.pure[Option, Unit, String]("beam me up!")
    scala> pureOpt.run(())
    res0: Option[String] = Some(beam me up!)
    Definition Classes
    KleisliFunctions
  53. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  54. def toString(): String
    Definition Classes
    AnyRef → Any
  55. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  56. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  57. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Deprecated Value Members

  1. def lift[F[_], A, B](x: F[B]): Kleisli[F, A, B]
    Definition Classes
    KleisliFunctions
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0-RC2) Use liftF instead

Inherited from Serializable

Inherited from Serializable

Inherited from KleisliExplicitInstances

Inherited from KleisliFunctionsBinCompat

Inherited from KleisliFunctions

Inherited from KleisliInstances

Inherited from KleisliInstances0

Inherited from KleisliInstances0_5

Inherited from KleisliInstances1

Inherited from KleisliInstances2

Inherited from KleisliInstances3

Inherited from KleisliInstances4

Inherited from KleisliInstances5

Inherited from KleisliInstances6

Inherited from KleisliInstances7

Inherited from KleisliInstances8

Inherited from KleisliInstances9

Inherited from AnyRef

Inherited from Any

Ungrouped