def finally

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

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

31# Run `act` whatever `m` answered with, after it: for cleanup.
32def finally(-A: Type, act: of(A), cleanup: of(Unit)) -> of(A):
33  IO.bind(Fs.Res(A), Fs.Res(A), act, r => IO.bind(Fs.Res(Unit), Fs.Res(A), cleanup, c => IO.pure(Fs.Res(A), r)))

Uses (5)

Used by (2)