def endpoint
bend-collections@1.0.0.0 · src/containers/dlist_iterator.bend:24
import bend-collections@1.0.0.0/src/containers/dlist_iterator.bend as DlistIterator
import Base
import bend-collections@1.0.0.0/src/containers/doubly_linked_list.bend as D
import bend-collections@1.0.0.0/src/containers/internal/dlist_storage.bend as R
24
25
26
27def endpoint(~T: Data, s: D.DList<T>, +front: Bool) -> D.DList<T> & U32:
28 D.DL{tag, depth, cap, raw, gens} = s
29 R.DL{owner, fresh, free, count, +head, +tail, rd, rc, vals, prevs, nexts} = raw
30 (D.DL{tag, depth, cap, R.DL{owner, fresh, free, count, head, tail, rd, rc, vals, prevs, nexts}, gens}, choose(U32, front, head, tail))