def write.opened
import ezx@1.11.0.0/src/io/file.bend as Fileimport Base
115# the text written to an opened file
116def write.opened(res: Result<&1, &1, U32 & String, File>, text: String) -> IO(Bool):
117 match res:
118 case Fail{_e}:
119 IO.pure(Bool, False{})
120 case Done{file}:
121 do IO<Bool>:
122 w : File & Result<&1, &1, U32 & String, Unit> <- File.write(file, text)
123 write.done(w)