type Deque
import bend-collections@1.0.0.0/src/containers/deque.bend as Dequeimport Base
4# Two-list deque: logical order is front ++ reverse(back).
5# Rebalance only when the requested side is empty, moving half the other
6# side. End operations are amortized O(1) along a consumed state history;
7# a rebalance is O(n). to_list is O(n). No arrays, handles or DLL storage.
8type Deque<-T: Data> is Type:
9 DE{front: List<&2, T>, back: List<&2, T>, nf: Nat, nb: Nat}