def slurp.cut
import bolt@1.27.0.0/src/lsp/files/disk.bend as Diskimport Base
16def slurp.cut(
17 bytes: List<&2, U32>,
18 file: File,
19 acc: List<&2, U32>,
20 rest: File -> List<&2, U32> -> IO(Maybe<&2, String>)
21) -> IO(Maybe<&2, String>):
22 match bytes:
23 case Nil{}:
24 slurp.end(file, acc)
25 case Con{b, t}:
26 rest(file, List.reverse.go(&2, U32, b <> t, acc))