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