keen/col/stack

Source
stack[t] record (has private fields)
Immutable stack type. Iterates from the bottom (least recently pushed) to the top (most recently pushed).
list-new[t] t stack(a t[])
The first element of a goes on the bottom and the last element of a goes on the top.
to[t] t stack(a t[])
Stack containing the given elements. The first element of a goes on the bottom and the last element of a goes on the top.
to[t] t[](a t stack)
is-empty[t] bool(a t stack)
true if a.size == 0.
~[t] t stack(a t stack, b t)
Appends an element to the stack. This is O(1).
size[t] nat64(a t stack)
Number of elements in the stack. This is O(1).
peek[t] t option(a t stack)
Top element. Returns an empty option if a is-empty. This is O(1).
pop[t] (t stack, t) option(a t stack)
Returns the top element of the a stacknd a new stack with all elements but the top. Returns an empty option if a is-empty.
some[t] bool(a t stack, f bool mut(t))
some-reverse[t] bool(a t stack, f bool mut(t))