Module Support.Stack

include module type of Stdlib.Stack
type !'a t = 'a Stdlib__Stack.t
exception Empty
val create : unit -> 'a t
val push : 'a -> 'a t -> unit
val pop : 'a t -> 'a
val pop_opt : 'a t -> 'a option
val top : 'a t -> 'a
val top_opt : 'a t -> 'a option
val clear : 'a t -> unit
val copy : 'a t -> 'a t
val is_empty : 'a t -> bool
val length : 'a t -> int
val iter : ('a -> unit) -> 'a t -> unit
val fold : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'b
val to_seq : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> 'a Stdlib.Seq.t -> unit
val of_seq : 'a Stdlib.Seq.t -> 'a t
val to_list : 'a t -> 'a list

to_list s converts s into a list, where the top element of s is the last element of the output list.

val to_list_rev : 'a t -> 'a list

to_list_rev s converts s into a list, where the top element of s is the first element of the list.