The success value type (what the effect produces on success)
The error type (what the effect produces on failure)
The dependencies required by this effect (satisfied via Dependency.provide)
The dependencies provided by this effect to inner effects
The success value type (what the effect produces on success)
The error type (what the effect produces on failure)
The dependencies required by this effect (satisfied via Dependency.provide)
The dependencies provided by this effect to inner effects
ReadonlypipeComposes this effect with one or more Pipeable operations into a single sequential effect.
One or more pipeable operations to apply after this effect
A new Effect representing the composed pipeline
This is a fluent convenience method equivalent to calling the standalone pipe function with this effect as the first argument. It accepts transform functions, error handlers, and dependency providers.
The core lazy, composable, cancellable computation type.
Remarks
An
Effectrepresents a deferred computation that, when executed via run, produces a success value of typeTor fails with an error of typeC. Effects are lazy — they do nothing until explicitly run.Effects can declare dependencies (type parameter
D) that must be satisfied via Dependency.provide before execution, and can provide dependencies to inner effects (type parameterP).Effects are iterable, which allows them to be composed with
yield*inside gen generator functions. They also expose a pipe method for fluent chaining with Pipeable operations.Use the factory functions fn, succeed, fail, and gen to create effects rather than instantiating this class directly.
Example