def meta_read

bendtorch-core@0.1.0.0 · src/storage/api.bend:663

import bendtorch-core@0.1.0.0/src/storage/api.bend as Api
import Base
import bendtorch-core@0.1.0.0/src/storage/main.bend as Storage
import bendtorch-core@0.1.0.0/src/storage/LAWS.bend as Laws

663def meta_read(+n: Nat, +value: F32, metadata: Nat & Nat, +ops: List<&2, Laws.Op>, +j: U32,
664  +fits: {Storage.bounds(Pair.fst(Nat, Nat, metadata), n) == True{} : Bool},
665  +inside: {Nat.is_lt(U32.to_nat(j), n) == True{} : Bool}) ->
666  {Laws.read(Laws.replay(ops, Laws.created.of(Storage.allocate_at(n, value, metadata))), j) ==
667    Done{Laws.expected(ops, n, j, value)} : Result<&2, &2, Storage.Error, F32>}:
668  (+d, +capacity) = metadata
669  alloc_read(d, n, value, Storage.bounds(d, n), {==}, ops, j, Equal.sym(Bool, Storage.bounds(d, n), True{}, fits), fits, inside)

Uses (21)

Used by (1)