def slurp.more
import ezx@1.11.0.0/src/io/file.bend as Fileimport Base
19# a failed read ends the file as surely as an empty one
20def slurp.more(
21 res: Result<&1, &1, U32 & String, String>,
22 file: File,
23 acc: String,
24 rest: File -> String -> IO(String)
25) -> IO(String):
26 match res:
27 case Fail{_e}:
28 slurp.end(file, acc)
29 case Done{chunk}:
30 slurp.cut(chunk, file, acc, rest)