APIFailure
Failure
Inspecting detached failures.
Fail.attemptReport and Fail.attemptDiagnostic report cleanup failures
raised while a computation unwound as Failure snapshots. A snapshot names
the effect operation that failed and keeps its arguments, but exposes no handler or
resumption. Snapshots retain their payloads, including resources; keeping a
snapshot does not extend a resource’s lifetime.
Failure
type FailureSource
A detached snapshot of one failure: the aborting operation and its
arguments, with any failures suppressed beneath it.
Show renders a metadata summary containing the effect, operation,
argument count, optional trace, and nested suppressed failures. Argument
contents remain opaque: snapshots do not retain their Show dictionaries.
Instances:
Show Failure
argument
argument : Int -> Failure -> Maybe aSource
The argument at a zero-based index, when it has the requested type,
including all its type arguments. A wrong type, an index out of range, and
a type containing functions or resources answer Nothing. An ordinary
immutable type is inspectable without exposing its constructors:
annotating payload : Maybe IO.Error and binding
payload = Failure.argument 0 failure reads an IO error.
argumentCount
argumentCount : Failure -> IntSource
How many arguments the failing operation was given.
effectName
effectName : Failure -> StringSource
The name of the effect whose operation failed, such as Fail.Fail.
operationName
operationName : Failure -> StringSource
The name of the operation that failed, such as Fail.fail.
suppressed
suppressed : Failure -> List FailureSource
The failures suppressed beneath this one, which keep their own.
trace
trace : Failure -> Maybe (List Frame)Source
The stack captured at this failure’s original abort site, innermost first.
Nothing means its handler did not request capture; Just [] means capture
was requested but found no frames. Reading a snapshot never captures the
current stack. Nested suppressed failures keep their own optional traces.
