FR
PréludeChargé par défaut — aucun import nécessaire.

Typed exceptions — the Throw effect

Synopsis
catch : (() -> a with Throw e) -> Result e a

Run a Throw-using computation, turning a throw e into Error e and a normal result into Ok a — the abortive handler for Throw. The result is pure, so catch is usable in ordinary (non-effectful) code.

catch (\_ -> parseField s) ⇒ Ok n, or Error msg if it threw.

(Handling an effect ALONGSIDE residual IO/FS — e.g. catching a readFile! — needs general handle/resume, a later feature.)