def file_read_got

gralha-byte-words@0.1.0.0 · words.bend:221

import gralha-byte-words@0.1.0.0/words.bend as Words
import Base

221def file_read_got(what: String, r: File & Result<&1, &1, U32 & String, Array<U32> & U32>) -> IO(Chunk):
222  (file, v) = r
223  match v:
224    case Done{(a, n)}:
225      IO.pure(Chunk, Chunk{file, a, n})
226    case Fail{e}:
227      do IO<Chunk>:
228        Unit <- File.close(file)
229        Unit <- fail(what, e)
230        IO.die(Chunk, 1, "unreachable")

Uses (15)

Used by (0)

No other definition uses this definition.