module Stack:imperative stacksig..end
exception OVERFLOW
type 'a stack
val create : 'a -> 'a stackcreate null_element creates an empty stack.
null element must be provided.val clear : 'a stack -> unitval is_empty : 'a stack -> boolval size : 'a stack -> intval push : 'a stack -> 'a -> unitOVERFLOW if the stack is full.val top : 'a stack -> 'aNot_found if the stack is empty.val pop : 'a stack -> 'aNot_found if the stack is empty.val remove_top : 'a stack -> unitNot_found if the stack is empty.val iter : ('a -> unit) -> 'a stack -> unitval fold : ('a -> 'b -> 'a) -> 'a -> 'b stack -> 'aval iter_stop : ('a -> unit) -> ('a -> bool) -> 'a stack -> unititer_stop apply stop like iter,
but stop the traversal if stop is true on a stack element.
stop is checked before apply.val map : ('a -> 'a) -> 'a stack -> 'a stackval sort : ('a -> 'a -> int) -> 'a stack -> unitval find : 'a stack -> ('a -> int) -> 'afind stack check finds the element specified by check.
stack must be sorted according to an ordering.
check delivers the result of this ordering
for the search for element and any stack element.
it returns 0, if the stack element is equal to the searchecd element,
-1, if the stack element is greater,
+1 otherwise.