Effect<A, E, R> class
abstract
The Effect type represents an immutable description of a workflow or operation that is lazily executed.
Type parameters:
A
(Success): The type of value that an effect can succeed withE
(Error): The type of expected errors that can occurR
(Requirements): The contextual data required by the effect
- Available extensions
Constructors
- Effect.new()
-
const
Properties
- errorType → Type
-
Available on Effect<
Extract the error typeA, E, R> , provided by the EffectTypes extensionno setter - hashCode → int
-
The hash code for this object.
no setterinherited
- requirementsType → Type
-
Available on Effect<
Extract the requirements typeA, E, R> , provided by the EffectTypes extensionno setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- successType → Type
-
Available on Effect<
Extract the success typeA, E, R> , provided by the EffectTypes extensionno setter
Methods
-
catchAll<
E2, R2> (Effect< A, E2, R2> f(E)) → Effect<A, E2, R2> - Catches and recovers from errors
-
flatMap<
B, E2, R2> (Effect< B, E2, R2> f(A)) → Effect<B, E2, R2> - Flat maps this effect with another effect
-
fork(
[Context< R> ? context]) → Fiber<A, E> -
Available on Effect<
Forks this effect into a fiber using the default runtimeA, E, R> , provided by the EffectRunner extension -
map<
B> (B f(A)) → Effect< B, E, R> - Maps the success value of this effect
-
mapError<
E2> (E2 f(E)) → Effect< A, E2, R> - Maps the error value of this effect
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
provideContext(
Context< R> context) → Effect<A, E, Never> - Provides the required context to this effect
-
provideService<
S extends Object, R2> (S service) → Effect< A, E, R2> - Provides a specific service to this effect
-
run(
[Context< R> ? context]) → Future<Exit< A, E> > -
Available on Effect<
Runs this effect using the default runtimeA, E, R> , provided by the EffectRunner extension -
runToExit(
[Context< R> ? context]) → Future<Exit< A, E> > - Runs this effect and returns an Exit
-
runUnsafe(
[Context< R> ? context]) → Future<A> - Runs this effect unsafely, throwing on failure
-
runUnsafeWithDefaultRuntime(
[Context< R> ? context]) → Future<A> -
Available on Effect<
Runs this effect unsafely using the default runtimeA, E, R> , provided by the EffectRunner extension -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
async<
A> (Future< A> computation()) → Effect<A, Object, Never> - Creates an effect from an asynchronous computation
-
die(
Object throwable) → Effect< Never, Never, Never> - Creates an effect that dies with the given throwable
-
fail<
E> (E error) → Effect< Never, E, Never> - Creates an effect that fails with the given error
-
service<
A extends Object> () → Effect< A, Never, A> - Creates an effect that requires a specific service from the context
-
succeed<
A> (A value) → Effect< A, Never, Never> - Creates an effect that succeeds with the given value
-
sync<
A> (A computation()) → Effect< A, Object, Never> - Creates an effect from a synchronous computation that might throw