HandlerExtensions

turbolift.internals.extensions.HandlerExtensions

No need to use this trait directly, because it's inherited by Handler's companion object.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Handler.type

Members list

Extensions

Extensions

extension [S, L, N](thiz: Handler[Tuple2, L, N])(thiz: Handler[Tuple2, L, N])
def ***![S2, S3, L2, N2](that: Handler[Tuple2, L2, N2])(using ET: ExtendTuple[S, S2, S3]): Handler[Tuple2, L & L2, N & N2]

Composes 2 independent handlers, also flattening their nested Tuple2 results.

Composes 2 independent handlers, also flattening their nested Tuple2 results.

((_, S1), S2) ~> (_, (S1, S2))
((_, S1, S2), S3) ~> (_, (S1, S2, S3))
((_, S1, S2, S3), S4) ~> (_, (S1, S2, S3, S4))
...

Attributes

def dropState: Id[L, N]

Transforms this handler, by dropping the second element of its Tuple2 result.

Transforms this handler, by dropping the second element of its Tuple2 result.

Attributes

def eval: Id[L, N]

Alias for dropState.

Alias for dropState.

Attributes

def exec: Const[S, L, N]

Alias for justState.

Alias for justState.

Attributes

def flatMapState[S2, U](f: S => Computation[S2, U]): Handler[Tuple2, L, N & U]

Like mapState, but the mapping function is effectful.

Like mapState, but the mapping function is effectful.

Attributes

def flatTapState[S2, U](f: S => Computation[Unit, U]): Handler[Tuple2, L, N & U]

Like flatMapState, but the mapping is executed for its effects only.

Like flatMapState, but the mapping is executed for its effects only.

Attributes

def justState: Const[S, L, N]

Transforms this handler, by dropping the first element of its Tuple2 result.

Transforms this handler, by dropping the first element of its Tuple2 result.

Attributes

def mapState[S2](f: S => S2): Handler[Tuple2, L, N]

Transforms this handler, by mapping the second element of its Tuple2 result.

Transforms this handler, by mapping the second element of its Tuple2 result.

Attributes

extension [L, N](thiz: Handler[Option, L, N])(thiz: Handler[Option, L, N])
def getOrDie(message: => String): Id[L, N]

Transforms this handler, by deconstructing its Option result.

Transforms this handler, by deconstructing its Option result.

Attributes

def getOrElse(default: => Nothing): Id[L, N]

Transforms this handler, by deconstructing its Option result.

Transforms this handler, by deconstructing its Option result.

Attributes

def toEither[E](e: => E): Handler[[_] =>> Either[E, _$8], L, N]

Transforms this handler, by mapping its Option result to Either.

Transforms this handler, by mapping its Option result to Either.

Attributes

def toTry(e: => Throwable): Handler[Try, L, N]

Transforms this handler, by mapping its Option result to Try.

Transforms this handler, by mapping its Option result to Try.

Attributes

def toVector: Handler[Vector, L, N]

Transforms this handler, by mapping its Option result to Vector.

Transforms this handler, by mapping its Option result to Vector.

Attributes

def unsafeGet: Id[L, N]

Transforms this handler, by deconstructing its Option result.

Transforms this handler, by deconstructing its Option result.

Attributes

def |||![L2, N2](that: Handler[Option, L2, N2]): Handler[Option, L & L2, N & N2]

Composes 2 independent handlers, also flattening their nested Option results.

Composes 2 independent handlers, also flattening their nested Option results.

Option[Option[_]] ~> Option[_]

Attributes

extension [E, L, N](thiz: Handler[[_] =>> Either[E, _$10], L, N])(thiz: Handler[[_] =>> Either[E, _$10], L, N])
def flatMapLeft[E2, U](f: E => Computation[E2, U]): Handler[[_] =>> Either[E2, _$12], L, N & U]

Like mapLeft, but the mapping function is effectful.

Like mapLeft, but the mapping function is effectful.

Attributes

def flatTapLeft[U](f: E => Computation[Unit, U]): Handler[[_] =>> Either[E, _$14], L, N & U]

Like flatMapLeft, but the mapping is executed for its effects only.

Like flatMapLeft, but the mapping is executed for its effects only.

Attributes

def getOrDie(message: E => String): Id[L, N]

Transforms this handler, by deconstructing its Either result.

Transforms this handler, by deconstructing its Either result.

Attributes

def getOrElse(default: E => Nothing): Id[L, N]

Transforms this handler, by deconstructing its Either result.

Transforms this handler, by deconstructing its Either result.

Attributes

def mapLeft[E2](f: E => E2): Handler[[_] =>> Either[E2, _$11], L, N]

Transforms this handler, by mapping the Left branch of its Either result.

Transforms this handler, by mapping the Left branch of its Either result.

Attributes

def toOption: Handler[Option, L, N]

Transforms this handler, by mapping its Either result to Option.

Transforms this handler, by mapping its Either result to Option.

Attributes

def toTry(implicit ev: E <:< Throwable): Handler[Try, L, N]

Transforms this handler, by mapping its Either result to Try.

Transforms this handler, by mapping its Either result to Try.

Attributes

def |||![E2, L2, N2](that: Handler[[_] =>> Either[E2, _$15], L2, N2]): Handler[[_] =>> Either[E | E2, _$16], L & L2, N & N2]

Composes 2 independent handlers, also flattening their nested Either results.

Composes 2 independent handlers, also flattening their nested Either results.

Either[E2, Either[E1, _]] ~> Either[E1 | E2, _]

Attributes