def h.eg_put_other

bend-kit-collections@0.1.4.1 · PROOF.bend:2132

import bend-kit-collections@0.1.4.1/PROOF.bend as PROOF
import Base
import bend-kit-collections@0.1.4.1/hmap.bend as M

2132def h.eg_put_other(
2133  ~K: Data, ~V: Data, ~eq: K -> K -> Bool,
2134  ~sound: @x: K -> @y: K -> {eq(x, y) == True{} : Bool} -> {x == y : K},
2135  xs: List<&2, M.Entry<K, V>>, +k2: K, +k: K, +v: V, +ne: {eq(k, k2) == False{} : Bool}
2136) -> {M.HMap.entries.get(~K, ~V, ~eq, M.HMap.entries.put(~K, ~V, ~eq, xs, k2, v), k)
2137      == M.HMap.entries.get(~K, ~V, ~eq, xs, k) : Maybe<&2, V>}:
2138  match xs:
2139    case Nil{}:
2140      %h.sb(eq(k, k2), False{}, ne) : {h.egc(~K, ~V, ~eq, _, v, Nil{}, k) == None{} : Maybe<&2, V>}
2141      {==}
2142    case Con{M.Entry{+key, +val}, +rest}:
2143      h.eg_put_other.c(~K, ~V, ~eq, ~sound, key, val, rest, k2, k, v, ne, eq(k2, key), {==},
2144        h.eg_put_other(~K, ~V, ~eq, ~sound, rest, k2, k, v, ne))

Uses (9)

Used by (4)