final case class CallbackKleisli[A, B](run: (A) ⇒ CallbackTo[B]) extends AnyVal with Product with Serializable
A => CallbackTo[B] aka Kleisli[CallbackTo, A, B] aka ReaderT[A, CallbackTo, B].
Never heard of Kleisli? Basically, a "Kleisli triple" is a function with the shape A => M[B].
In this case, the M is hard-coded to CallbackTo.
This is hard-coded to CallbackTo for the same reasons as CallbackOption
and for the same reasons that CallbackTo exists.
- Since
1.2.0
- Alphabetic
- By Inheritance
- CallbackKleisli
- Serializable
- Serializable
- Product
- Equals
- AnyVal
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new CallbackKleisli(run: (A) ⇒ CallbackTo[B])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
def
*>[C](next: CallbackKleisli[A, C]): CallbackKleisli[A, C]
Alias for
>>.Alias for
>>.Where
>>is often associated with Monads,*>is often associated with Applicatives.- Annotations
- @inline()
-
def
<*[C](next: CallbackKleisli[A, C]): CallbackKleisli[A, B]
Sequence actions, discarding the value of the second argument.
-
def
<<[C](prev: CallbackKleisli[A, C]): CallbackKleisli[A, B]
Sequence a CallbackKleisli to run before this, discarding any value produced by it.
Sequence a CallbackKleisli to run before this, discarding any value produced by it.
- Annotations
- @inline()
-
def
<<?[C](prev: Option[CallbackKleisli[A, C]]): CallbackKleisli[A, B]
Convenient version of
<<that accepts an Option -
def
<=<[C](prev: CallbackKleisli[C, A]): CallbackKleisli[C, B]
- Annotations
- @inline()
-
def
<|(t: (B) ⇒ Any): CallbackKleisli[A, B]
Alias for
tap.Alias for
tap.- Annotations
- @inline()
- def =<<(a: CallbackTo[A]): CallbackTo[B]
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
- def >=>[C](next: CallbackKleisli[B, C]): CallbackKleisli[A, C]
-
def
>>[C](next: CallbackKleisli[A, C]): CallbackKleisli[A, C]
Sequence a CallbackKleisli to run after this, discarding any value produced by this.
-
def
>>=[C](f: (B) ⇒ CallbackKleisli[A, C]): CallbackKleisli[A, C]
Alias for
flatMap.Alias for
flatMap.- Annotations
- @inline()
-
def
andThen[C](next: CallbackKleisli[B, C]): CallbackKleisli[A, C]
- Annotations
- @inline()
-
def
apply(a: A): CallbackTo[B]
- Annotations
- @inline()
- def asCallback: CallbackTo[(A) ⇒ B]
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
attempt: CallbackKleisli[A, Either[Throwable, B]]
Wraps this callback in a try-catch and returns either the result or the exception if one occurs.
-
def
attemptTry: CallbackKleisli[A, Try[B]]
Wraps this callback in a scala
Trywith catches what it considers non-fatal errors.Wraps this callback in a scala
Trywith catches what it considers non-fatal errors.Use attempt to catch everything.
-
def
compose[C](prev: CallbackKleisli[C, A]): CallbackKleisli[C, B]
- Annotations
- @inline()
- def contramap[C](f: (C) ⇒ A): CallbackKleisli[C, B]
- def contramapCB[C](f: (C) ⇒ CallbackTo[A]): CallbackKleisli[C, B]
-
def
dimap[C, D](f: (C) ⇒ A, g: (B) ⇒ D): CallbackKleisli[C, D]
- Annotations
- @inline()
- def flatMap[C](f: (B) ⇒ CallbackKleisli[A, C]): CallbackKleisli[A, C]
- def flatTap[C](t: (B) ⇒ CallbackKleisli[A, C]): CallbackKleisli[A, B]
-
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def map[C](f: (B) ⇒ C): CallbackKleisli[A, C]
- def mapCB[C](f: (CallbackTo[B]) ⇒ CallbackTo[C]): CallbackKleisli[A, C]
- def narrow[C <: A]: CallbackKleisli[C, B]
-
def
ret[C](c: C): CallbackKleisli[A, C]
Discard the callback's return value, return a given value instead.
Discard the callback's return value, return a given value instead.
ret, short forreturn. - val run: (A) ⇒ CallbackTo[B]
- def strongL[R]: CallbackKleisli[(A, R), (B, R)]
- def strongR[L]: CallbackKleisli[(L, A), (L, B)]
-
def
tap(t: (B) ⇒ Any): CallbackKleisli[A, B]
When the callback result becomes available, perform a given side-effect with it.
- def toCallback(a: CallbackTo[A]): CallbackTo[B]
- def toJsFn: Function1[A, B]
-
def
underlyingRepr: (A) ⇒ CallbackTo[B]
- Annotations
- @inline()
-
def
unless(test: (A) ⇒ Boolean): CallbackKleisli[A, Option[B]]
- Annotations
- @inline()
-
def
unless_(test: (A) ⇒ Boolean): CallbackKleisli[A, Unit]
- Annotations
- @inline()
-
def
void: CallbackKleisli[A, Unit]
Discard the value produced by this callback.
-
def
voidExplicit[C](implicit ev: <:<[B, C]): CallbackKleisli[A, Unit]
Discard the value produced by this callback.
Discard the value produced by this callback.
This method allows you to be explicit about the type you're discarding (which may change in future).
- Annotations
- @inline()
- def when(test: (A) ⇒ Boolean): CallbackKleisli[A, Option[B]]
- def when_(test: (A) ⇒ Boolean): CallbackKleisli[A, Unit]
- def widen[C >: B]: CallbackKleisli[A, C]
- def zip[C](cb: CallbackKleisli[A, C]): CallbackKleisli[A, (B, C)]
-
def
|>[C](f: (B) ⇒ C): CallbackKleisli[A, C]
Alias for
map.Alias for
map.- Annotations
- @inline()