def add_found

bend-collections-laws-math@1.0.0.0 · proofs/lib/lemmas/src/cache.bend:134

import bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/src/cache.bend as Cache
import Base
import bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/types/model.bend as T

134def add_found(-K: Data, -V: Data, +c: Cache<K, V>, code: String, key: K, value: V, deadline: T.Int64, found: Maybe<&2, T.Entry<K, V>>) -> Step<K, V>:
135  match found:
136    case None{}:
137      add_room(K, V, c, code, key, value, deadline, Nat.is_ge(len(K, V, c), capacity(K, V, c)))
138    case Some{T.Item{original, old, expiry}}:
139      store(K, V, c, code, original, value, deadline, False{}, Nil{})

Uses (13)

Used by (1)