def read_hit
bendtorch-core@0.1.0.0 · src/storage/api.bend:36
import bendtorch-core@0.1.0.0/src/storage/api.bend as Api
import Base
import bendtorch-core@0.1.0.0/src/storage/model.bend as Model
import bendtorch-core@0.1.0.0/src/storage/refinement.bend as Refinement
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
36def read_hit(+d: Nat, +n: Nat, array: Array<F32>, -balanced: Model.Balanced(F32, d, array),
37 -valid: {Storage.bounds(d, n) == True{} : Bool}, +fits: {Storage.bounds(d, n) == True{} : Bool},
38 +i: U32, +inside: {Nat.is_lt(U32.to_nat(i), n) == True{} : Bool}) ->
39 {Laws.read(Storage.Owned{d, n, array, balanced, valid}, i) ==
40 Done{Refinement.second(F32, Array.get(F32, array, i))} : Result<&2, &2, Storage.Error, F32>}:
41 get_checked_hit(d, n, array, i, Nat.is_lt(U32.to_nat(i), n), {==}, balanced, valid,
42 Equal.sym(Bool, Nat.is_lt(U32.to_nat(i), n), True{}, inside), fits, inside)