Deque.Deque: type of bend-collections-laws-math@1.0.0.0 Import: import bend-collections-laws-math@1.0.0.0/src/containers/deque.bend as Deque Lines 4-9 of bend-collections-laws-math@1.0.0.0/src/containers/deque.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-math@1.0.0.0/src/containers/deque.bend&start_line=4&end_line=9 import Base # Two-list deque: logical order is front ++ reverse(back). # Rebalance only when the requested side is empty, moving half the other # side. End operations are amortized O(1) along a consumed state history; # a rebalance is O(n). to_list is O(n). No arrays, handles or DLL storage. type Deque<-T: Data> is Type: DE{front: List<&2, T>, back: List<&2, T>, nf: Nat, nb: Nat} Uses (2): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat