Impl.PipeSession.ask.go: def of bend-pipe-session@0.2.0.0 Import: import bend-pipe-session@0.2.0.0/impl.bend as Impl Lines 62-96 of bend-pipe-session@0.2.0.0/impl.bend: https://jend.leeeet.dev/read.txt?path=bend-pipe-session@0.2.0.0/impl.bend&start_line=62&end_line=96 import Base import bend-stdio-pipes@0.2.0.0/impl.bend as Stdio # said holds the lines so far, the last first; fuel bounds the lines, far beyond any answer. def PipeSession.ask.go( fuel: Nat, at: File & Heard, +until: String, +line_cap: U32, said: List<&2, String> ) -> IO(File & Result<&1, &1, U32 & String, List<&2, String>>): match fuel: case 0n: match at: case (out, _): IO.pure( File & Result<&1, &1, U32 & String, List<&2, String>>, (out, Fail{(5, "the program said too many lines before " ++ until)}) ) case 1n+rest: match at: case (out, Failed{error}): IO.pure(File & Result<&1, &1, U32 & String, List<&2, String>>, (out, Fail{error})) case (out, Ended{}): IO.pure( File & Result<&1, &1, U32 & String, List<&2, String>>, (out, Fail{(PipeSession.ended(), "the program ended before it said " ++ until)}) ) case (out, Last{text}): IO.pure( File & Result<&1, &1, U32 & String, List<&2, String>>, (out, Done{List.reverse(&2, String, text <> said)}) ) case (out, Line{text}): do IO>>: read: File & Result<&1, &1, U32 & String, Maybe> <- Stdio.read_line(out, line_cap) PipeSession.ask.go(rest, Heard.read(read, until), until, line_cap, text <> said) Uses (18): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=File 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=List.reverse https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=Heard https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=Heard.read https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=PipeSession.ended https://jend.leeeet.dev/definition.txt?path=bend-stdio-pipes@0.2.0.0/impl.bend&name=read_line