def sys.write.opened
ezsys@0.1.0.0 · src/sys.bend:117
import ezsys@0.1.0.0/src/sys.bend as Sys
import Base
117
118def sys.write.opened(
119 text: String,
120 res: Result<&1, &1, U32 & String, File>
121) -> IO(Result<&1, &1, U32 & String, Unit>):
122 match res:
123 case Fail{error}:
124 IO.pure(Result<&1, &1, U32 & String, Unit>, Fail{error})
125 case Done{file}:
126 IO.bind(File & Result<&1, &1, U32 & String, Unit>,
127 Result<&1, &1, U32 & String, Unit>, File.write(file, text),
128 sys.write.done)