Error
Error effect with contextual messages and multiple handler strategies.
collecting
Collecting error handler: accumulates errors in state as a list. Resumes computation with null so subsequent effects still execute. Use when you want all errors, not just the first.
State shape: list of { message, context }
raise
Raise an error. Returns a Computation that sends an "error" effect. The handler determines what happens: throw, collect, or recover.
raise : string -> Computation a
raiseWith
Raise an error with context. The context string describes where in the computation the error occurred, enabling stack-trace-like error reports when used with the collecting handler.
raiseWith : string -> string -> Computation a
result
Result error handler: aborts computation with tagged Error value. Uses the non-resumption protocol to discard the continuation.
Returns { _tag = "Error"; message; context; } on error.
strict
Strict error handler: throws on first error via builtins.throw. Use when errors should halt evaluation immediately.
Includes context in the thrown message when available.