Lock.held.pick: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/lock.bend as Lock Lines 46-53 of cswap-bend-cli@0.1.0.0/lock.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/lock.bend&start_line=46&end_line=53 import Base import cswap-bend-cli@0.1.0.0/fs.bend as Fs def held.pick(f: File, r: Fs.Res(Bool)) -> IO(Fs.Res(Maybe<&1, File>)): match r: case Fail{e}: IO.bind(Unit, Fs.Res(Maybe<&1, File>), File.close(f), u => IO.pure(Fs.Res(Maybe<&1, File>), Fail{e})) case Done{True{}}: IO.pure(Fs.Res(Maybe<&1, File>), Done{Some{f}}) case Done{False{}}: IO.bind(Unit, Fs.Res(Maybe<&1, File>), File.close(f), u => IO.pure(Fs.Res(Maybe<&1, File>), Done{None{}})) Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=File https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=File.close https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/fs.bend&name=Res