File.slurp: def of ezx@1.11.0.0 Import: import ezx@1.11.0.0/src/io/file.bend as File Lines 41-49 of ezx@1.11.0.0/src/io/file.bend: https://jend.leeeet.dev/read.txt?path=ezx@1.11.0.0/src/io/file.bend&start_line=41&end_line=49 import Base # the whole file, read in chunks until one is empty, or the fuel is def slurp(fuel: Nat, file: File, acc: String) -> IO(String): match fuel: case 0n: slurp.end(file, acc) case 1n+f: do IO: got : File & Result<&1, &1, U32 & String, String> <- File.read(file, 65536) slurp.next(got, acc, fl => a => slurp(f, fl, a)) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=File https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=File.read 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=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=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/io/file.bend&name=slurp.end https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/io/file.bend&name=slurp.next