Handler

turbolift.Handler$
See theHandler companion trait
object Handler extends HandlerExtensions

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Show all
Self type
Handler.type

Members list

Type members

Types

type Const[Result, Elim, Intro] = Handler[[X] =>> Result, Elim, Intro]

Alias for handler, whose Result[_] is a type-level constant function.

Alias for handler, whose Result[_] is a type-level constant function.

Attributes

type Free[Result[_], Elim] = Handler[Result, Elim, Any]

Alias for handler that has no dependencies (introduces no new effects).

Alias for handler that has no dependencies (introduces no new effects).

Attributes

type FreeConst[Result, Elim] = Handler[[X] =>> Result, Elim, Any]

Alias for handler, that is both Free and Const.

Alias for handler, that is both Free and Const.

Attributes

type FreeId[Elim] = Handler[[X] =>> X, Elim, Any]

Alias for handler, that is both Free and Id.

Alias for handler, that is both Free and Id.

Attributes

type Id[Elim, Intro] = Handler[[X] =>> X, Elim, Intro]

Alias for handler, whose Result[_] is type-level identity.

Alias for handler, whose Result[_] is type-level identity.

Attributes

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def flatHandle[F[_], L, N1, N2](h: Computation[Handler[F, L, N1], N2]): Handler[F, 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

Extensions

Inherited 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

Inherited from:
HandlerExtensions
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

Inherited from:
HandlerExtensions
def eval: Id[L, N]

Alias for dropState.

Alias for dropState.

Attributes

Inherited from:
HandlerExtensions
def exec: Const[S, L, N]

Alias for justState.

Alias for justState.

Attributes

Inherited from:
HandlerExtensions
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

Inherited from:
HandlerExtensions
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

Inherited from:
HandlerExtensions
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

Inherited from:
HandlerExtensions
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

Inherited from:
HandlerExtensions
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

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

Transforms this handler, by deconstructing its Option result.

Transforms this handler, by deconstructing its Option result.

Attributes

Inherited from:
HandlerExtensions
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

Inherited from:
HandlerExtensions
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

Inherited from:
HandlerExtensions
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

Inherited from:
HandlerExtensions
def unsafeGet: Id[L, N]

Transforms this handler, by deconstructing its Option result.

Transforms this handler, by deconstructing its Option result.

Attributes

Inherited from:
HandlerExtensions
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

Inherited from:
HandlerExtensions
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

Inherited from:
HandlerExtensions
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

Inherited from:
HandlerExtensions
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

Inherited from:
HandlerExtensions
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

Inherited from:
HandlerExtensions
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

Inherited from:
HandlerExtensions
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

Inherited from:
HandlerExtensions
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

Inherited from:
HandlerExtensions
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

Inherited from:
HandlerExtensions