def open.cut
bend-kit-journal@0.3.1.0 · journal.bend:311
import bend-kit-journal@0.3.1.0/journal.bend as Journal
import Base
311def open.cut(r: File & Result<&1, &1, U32 & String, Unit>, +max: U32, +end: U32, -A: Type, acc: A) -> IO(Result<&1, &1, U32 & String, Journal & A>):
312 match r:
313 case (file, Fail{e}):
314 do IO<Result<&1, &1, U32 & String, Journal & A>>:
315 File.close(file)
316 return Fail{e}
317 case (file, Done{u}):
318 do IO<Result<&1, &1, U32 & String, Journal & A>>:
319 return Done{(Journal{file, max, end, True{}}, acc)}