Package: effect
Module: Cause
Describes methods for reducing a Cause<E> into a value of type Z with
access to contextual information.
Details
This interface is meant for advanced transformations of Cause. By
implementing each method, you can define how different parts of the Cause
structure (like Fail, Die, or Interrupt) should be transformed into a
final type Z. The context parameter carries additional data needed during
this reduction.
See
reduceWithContext Apply a CauseReducer to transform a CauseSignature
export interface CauseReducer<in C, in E, in out Z> {
emptyCase(context: C): Z
failCase(context: C, error: E): Z
dieCase(context: C, defect: unknown): Z
interruptCase(context: C, fiberId: FiberId.FiberId): Z
sequentialCase(context: C, left: Z, right: Z): Z
parallelCase(context: C, left: Z, right: Z): Z
}
Since v2.0.0