Handler

turbolift.Handler
See theHandler companion trait
object Handler

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Handler.type

Members list

Type members

Classlikes

object FromConst

Type-level fluent interface for accessing Handler type aliases.

Type-level fluent interface for accessing Handler type aliases.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
FromConst.type
object FromId

Type-level fluent interface for accessing Handler type aliases.

Type-level fluent interface for accessing Handler type aliases.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
FromId.type
object ToConst

Type-level fluent interface for accessing Handler type aliases.

Type-level fluent interface for accessing Handler type aliases.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
ToConst.type
object ToId

Type-level fluent interface for accessing Handler type aliases.

Type-level fluent interface for accessing Handler type aliases.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
ToId.type

Types

type Free[F[_], G[_], Elim] = Handler[F, G, Elim, Any]

Alias for Handler, that has no dependencies.

Alias for Handler, that has no dependencies.

Attributes

type FromConst[C, To[_], Elim, Intro] = Handler[[_] =>> C, To, Elim, Intro]

Alias for Handler, whose From[_] is type-level constant function.

Alias for Handler, whose From[_] is type-level constant function.

Attributes

type FromId[To[_], Elim, Intro] = Handler[[X] =>> X, To, Elim, Intro]

Alias for Handler, where From[_] is type-level identity.

Alias for Handler, where From[_] is type-level identity.

Attributes

type ToConst[F[_], D, Elim, Intro] = Handler[F, [_] =>> D, Elim, Intro]

Alias for Handler, where To[_] is type-level constant function.

Alias for Handler, where To[_] is type-level constant function.

Attributes

type ToId[F[_], Elim, Intro] = Handler[F, [X] =>> X, Elim, Intro]

Alias for Handler, where To[_] is type-level identity.

Alias for Handler, where To[_] is type-level identity.

Attributes

Value members

Concrete methods

def flatHandle[F[_], G[_], L, N1, N2](h: Computation[Handler[F, G, L, N1], N2]): Handler[F, G, L, N1 & N2]

Transforms a computation of a handler, into a new handler.

Transforms a computation of a handler, into a new handler.

Useful for effectful creation of handlers. Effects requested to create the handler are absorbed by the handler itself, into its own (additional) dependencies.

Attributes

def identity[F[_]]: Handler[F, F, Any, Any]

Extensions

Extensions

extension [F[_], S, L, N](thiz: Handler[F, Tuple2, L, N])
def ***![S2, S3, L2, N2](that: FromId[Tuple2, L2, N2])(using ET: ExtendTuple[S, S2, S3]): Handler[F, 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: ToId[F, 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: ToId[F, L, N]

Alias for dropState.

Alias for dropState.

Attributes

def exec: ToConst[F, S, L, N]

Alias for justState.

Alias for justState.

Attributes

def flatMapState[S2, U](f: S => Computation[S2, U]): Handler[F, 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[F, 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: ToConst[F, 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[F, 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 [F[_], L, N](thiz: Handler[F, Option, L, N])
def getOrDie(message: => String): ToId[F, L, N]

Transforms this handler, by deconstructing its Option result.

Transforms this handler, by deconstructing its Option result.

Attributes

def getOrElse(default: => Nothing): ToId[F, 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[F, [_] =>> Either[E, _$48], 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[F, 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[F, 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: ToId[F, L, N]

Transforms this handler, by deconstructing its Option result.

Transforms this handler, by deconstructing its Option result.

Attributes

def |||![L2, N2](that: FromId[Option, L2, N2]): Handler[F, 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 [F[_], E, L, N](thiz: Handler[F, [_] =>> Either[E, _$51], L, N])
def flatMapLeft[E2, U](f: E => Computation[E2, U]): Handler[F, [_] =>> Either[E2, _$53], 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[F, [_] =>> Either[E, _$55], 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): ToId[F, L, N]

Transforms this handler, by deconstructing its Either result.

Transforms this handler, by deconstructing its Either result.

Attributes

def getOrElse(default: E => Nothing): ToId[F, 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[F, [_] =>> Either[E2, _$52], 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[F, 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[F, 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: FromId[[_] =>> Either[E2, _$56], L2, N2]): Handler[F, [_] =>> Either[E | E2, _$57], 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