def file.slurp.cut
import snap@1.4.0.0/src/file.bend as Fileimport Base
10# an empty chunk means the end of the file
11def file.slurp.cut(chunk: String, file: File, acc: String, rest: File -> String -> IO(String)) -> IO(String):
12 match chunk:
13 case SNil{}:
14 file.slurp.end(file, acc)
15 case SCon{c, t}:
16 rest(file, acc ++ SCon{c, t})