File.read.opened: def of ezx@1.11.0.0 Import: import ezx@1.11.0.0/src/io/file.bend as File Lines 83-92 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=83&end_line=92 import Base # what an opened file holds, or nothing when it would not open def read.opened(res: Result<&1, &1, U32 & String, File>) -> IO(Maybe<&2, String>): match res: case Fail{_e}: IO.pure(Maybe<&2, String>, None{}) case Done{file}: do IO>: got : File & Result<&1, &1, U32 & String, U32> <- File.size(file) text : String <- read.sized(got) return Some{text} 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.size 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=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe 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=read.sized