keen/col/mut-deque

Source
mut-deque[t] record (has private fields)
Mutable double-ended queue.
new[t] t mut-deque()
New empty mut-deque.
to[t] t[](a t mut-deque)
Copy elements to a list. This is O(n).
copy[t] t mut-deque(a t mut-deque)
Copy elements to a new deque. This is O(n).
is-empty[t] bool(a t mut-deque)
true iff a.size == 0.
size[t] nat64(a t mut-deque)
Number of elements in the deque.
push[t] void(value t, a t mut-deque)
Add a new value on the left.
push[t] void(a t mut-deque, value t)
Add a new value on the right.
peek-left[t] t option(a t mut-deque)
Returns the leftmost element without removing it. Returns an empty option if a is-empty.
peek-right[t] t option(a t mut-deque)
Returns the rightmost element without removing it. Returns an empty option if a is-empty.
pop-left[t] t option(a t mut-deque)
Removes and returns the leftmost element. Returns an empty option if a is-empty.
pop-right[t] t option(a t mut-deque)
Removes and returns the rightmost element. Returns an empty option if a is-empty.