def run_held
cswap-bend-cli@0.1.0.0 · daemon/pidlock.bend:61
import cswap-bend-cli@0.1.0.0/daemon/pidlock.bend as Pidlock
import Base
import cswap-bend-cli@0.1.0.0/fs.bend as Fs
import cswap-bend-cli@0.1.0.0/act.bend as Act
import cswap-bend-cli@0.1.0.0/lock.bend as Lock
61def run_held(-A: Type, +state_dir: String, f: File, c: Fs.Res(Unit), act: Act.of(A)) -> Act.of(A):
62 match c:
63 case Fail{e}:
64 IO.bind(Unit, Fs.Res(A), Lock.release(f), u => IO.pure(Fs.Res(A), Fail{e}))
65 case Done{u}:
66 Act.finally(A, act, give_back(state_dir, f))