Run.alive: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/tui/run.bend as Run Lines 129-135 of cswap-bend-cli@0.1.0.0/tui/run.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/tui/run.bend&start_line=129&end_line=135 import Base # Is the daemon's pid alive? `kill -0` answers without signalling. def alive(+pid: Maybe<&2, U32>) -> IO(Bool): match pid: case None{}: IO.pure(Bool, False{}) case Some{p}: IO.bind(Result<&1, &1, U32 & String, U32 & (String & String)>, Bool, Process.run("kill", ["-0", U32.show(p)], "", 64, 2000), r => IO.pure(Bool, U32.is_eq(code_pick(r), 0))) Uses (14): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool 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=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Process.run https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.show https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/tui/run.bend&name=code_pick