def open.read
bend-kit-journal@0.3.1.0 · journal.bend:340
import bend-kit-journal@0.3.1.0/journal.bend as Journal
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
340def open.read(~A: Type, ~step: A -> Bytes.Bytes -> A, r: Result<&1, &1, U32 & String, File & U32 & Array<U32>>, +max: U32, acc: A) -> IO(Result<&1, &1, U32 & String, Journal & A>):
341 match r:
342 case Fail{e}:
343 do IO<Result<&1, &1, U32 & String, Journal & A>>:
344 return Fail{e}
345 case Done{(file, (len, words))}:
346 open.replayed(file, max, A, replay.bytes(~A, ~step, max, Bytes.Bytes{len, words}, acc))