DlistStorage.rmf_links: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/src/containers/internal/dlist_storage.bend as DlistStorage Lines 401-408 of bend-collections@1.0.0.0/src/containers/internal/dlist_storage.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/containers/internal/dlist_storage.bend&start_line=401&end_line=408 import Base # Unlink the element at slot i and push i on the free stack. `set_next` writes # at the NEIGHBOUR slots (both different from i), so the last write, which # stores the old top in nexts[i], cannot be overwritten. def rmf_links(~T: Data, +tag: U32, +fresh: U32, +free: U32, count: Nat, +head: U32, +tail: U32, +depth: Nat, +cap: U32, vals: Array>, +i: U32, v: T, pr: Array & U32, nx: Array & U32) -> DList & Maybe<&2, T>: (prevs, +p) = pr (nexts, +n) = nx (DL{tag, fresh, link(i), Nat.sub(count, 1n), pick_end(U32.is_eq(p, nil()), n, head), pick_end(U32.is_eq(n, nil()), p, tail), depth, cap, vals, set_next(prevs, n, p), Array.set(U32, set_next(nexts, p, n), i, free)}, Some{v}) Uses (14): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.set https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/internal/dlist_storage.bend&name=DList https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/internal/dlist_storage.bend&name=link https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/internal/dlist_storage.bend&name=nil https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/internal/dlist_storage.bend&name=pick_end https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/internal/dlist_storage.bend&name=set_next