12345678910111213141516171819202122232425262728293031323334353637383940414243444546moduletypeOps=sigtype'attype('x,'fn)fnvalis_empty:('x,'at->bool)fn(** [is_empty s] determines whether the stack [s] is empty. *)vallength:('x,'at->int)fn(** [length s] returns the length of the stack [s]. *)valclear:('x,'at->unit)fn(** [clear s] removes all elements from the stack [s]. *)valswap:('x,'at->'at->unit)fn(** [swap s1 s2] exchanges the contents of the stacks [s1] and [s2]. *)valto_seq:('x,'at->'aSeq.t)fn(** [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. *)valpush:('x,'a->'at->unit)fn(** [push x s] adds the element [x] to the top of the stack [s]. *)valpop_opt:('x,'at->'aoption)fn(** [pop_opt s] removes and returns the topmost element of the stack [s], or
[None] if the stack is empty. *)valpop_all:('x,'at->'aSeq.t)fn(** [pop_all s] removes and returns a domain safe sequence for iterating
through all the elements that were in the stack top to bottom. *)valpop_blocking:('x,'at->'a)fn(** [pop_blocking s] removes and returns the topmost element of the stack [s],
or blocks waiting for the queue to become non-empty. *)valtop_opt:('x,'at->'aoption)fn(** [top_opt s] returns the topmost element in stack [s], or [None] if the
stack is empty. *)valtop_blocking:('x,'at->'a)fn(** [top_blocking s] returns the topmost element in stack [s], or blocks
waiting for the queue to become non-empty. *)end