def on_fail

cswap-bend-cli@0.1.0.0 · act.bend:58

import cswap-bend-cli@0.1.0.0/act.bend as Act
import Base
import cswap-bend-cli@0.1.0.0/fs.bend as Fs

58# Run `cleanup` only when `act` failed, and still answer the failure.
59def on_fail(-A: Type, act: of(A), cleanup: of(Unit)) -> of(A):
60  IO.bind(Fs.Res(A), Fs.Res(A), act, r => on_fail2(A, r, cleanup))

Uses (5)

Used by (1)