Used to delimit scope of effect(s).
Handler transforms a Computation, by discharging some or all of its requested effects, and (optionally) introducing handlers own dependencies to it (set of effects used to create the handler).
val myComputation2 = myComputation1.handleWith(myHandler)
Handlers can be obtained:
- By implementing an Interpreter for an Effect, and then, obtaining a Handler from it.
- By transforming a preexisting handler, e.g.
val myHandler2 = myHandler1.map(...)
- By composing 2 preexisting handlers, e.g.
val myHandler3 = myHandler1 &&&! myHandler2
Compositon of 2 handlers is always sequential: the operands are applied in left to right order.
Attributes
- Elim
Type-level set of effects, that this handler eliminates from the computation.
- Intro
Type-level set of effects, that this handler introduces into the computation. This is often an empty set, expressed as
Any
.- Result
Type constructor (e.g.
Option[_]
), in which the computation's result is wrapped, after application of this handler. This is often an identity.- Companion:
- object
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
Members list
Type members
Classlikes
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
Value members
Concrete methods
Alias for composeWith.
Composes 2 independent handlers.
Composes 2 independent handlers.
Independence of handlers means, that effects eliminated by one of the handlers, do not overlap with effects introduced by the other.
Independence of 2 handlers guarantees, that it's also valid to compose them in the opposite order.
However, nesting order of their Result[_]
s would also be reversed.
Attributes
Applies this handler to given computation.
Transforms this handler, by applying a post-processing function to its result`.
Transforms this handler, by applying a post-processing function to its result`.
a.k.a Natural Transformation.
Attributes
Composes 2 partially dependent handlers.
Composes 2 partially dependent handlers.
Assumes that some of effects introduced by this handler, are eliminated by that
handler.
Attributes
Composes 2 fully dependent handlers.
Composes 2 fully dependent handlers.
Assumes that all effects introduced by this handler, are eliminated by that
handler.
Attributes
Inherited methods
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 (hidden)
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 (hidden)
Alias for dropState.
Alias for dropState.
Attributes
- Inherited from:
- HandlerExtensions (hidden)
Alias for justState.
Alias for justState.
Attributes
- Inherited from:
- HandlerExtensions (hidden)
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 (hidden)
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 (hidden)
Transforms this handler, by deconstructing its Either
result.
Transforms this handler, by deconstructing its Either
result.
Attributes
- Inherited from:
- HandlerExtensions (hidden)
Transforms this handler, by deconstructing its Option
result.
Transforms this handler, by deconstructing its Option
result.
Attributes
- Inherited from:
- HandlerExtensions (hidden)
Transforms this handler, by deconstructing its Either
result.
Transforms this handler, by deconstructing its Either
result.
Attributes
- Inherited from:
- HandlerExtensions (hidden)
Transforms this handler, by deconstructing its Option
result.
Transforms this handler, by deconstructing its Option
result.
Attributes
- Inherited from:
- HandlerExtensions (hidden)
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 (hidden)
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 (hidden)
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 (hidden)
Transforms this handler, by mapping its Option
result to Either
.
Transforms this handler, by mapping its Option
result to Either
.
Attributes
- Inherited from:
- HandlerExtensions (hidden)
Transforms this handler, by mapping its Either
result to Option
.
Transforms this handler, by mapping its Either
result to Option
.
Attributes
- Inherited from:
- HandlerExtensions (hidden)
Transforms this handler, by mapping its Either
result to Try
.
Transforms this handler, by mapping its Either
result to Try
.
Attributes
- Inherited from:
- HandlerExtensions (hidden)
Transforms this handler, by mapping its Option
result to Try
.
Transforms this handler, by mapping its Option
result to Try
.
Attributes
- Inherited from:
- HandlerExtensions (hidden)
Transforms this handler, by mapping its Option
result to Vector
.
Transforms this handler, by mapping its Option
result to Vector
.
Attributes
- Inherited from:
- HandlerExtensions (hidden)
Transforms this handler, by deconstructing its Option
result.
Transforms this handler, by deconstructing its Option
result.
Attributes
- Inherited from:
- HandlerExtensions (hidden)
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 (hidden)
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 (hidden)