Page
Library
Module
Module type
Parameter
Class
Class type
Source
Kcas_data.StackSourceLast-In First-Out (LIFO) stack.
The interface provides a subset of the OCaml Stdlib.Stack module. add_seq is not provided at all. Compositional versions of iter, fold, pop, and top are not provided.
The implementation is essentially a Treiber stack with randomized exponential backoff and support for constant time length.
The type of stacks containing elements of type 'a.
to_seq s returns a domain safe sequence for iterating through the elements of the stack top to bottom.
The sequence is based on a constant time, O(1), snapshot of the stack and modifications of the stack have no effect on the sequence.
pop_opt s removes and returns the topmost element of the stack s, or None if the stack is empty.
top_opt s returns the topmost element in stack s, or None if the stack is empty.
pop s removes and returns the topmost element in stack s, or raises Empty if the stack is empty.
top s returns the topmost element in stack s, or raises Empty if the stack is empty.