Module CCListLabels.Ref
val push : 'a t -> 'a -> unit
push rlist e
adds an elemente
at the head ofrlist
.
val pop : 'a t -> 'a option
pop rlist
removes and returnsSome e
(the first element ofrlist
) orNone
if therlist
is empty
val pop_exn : 'a t -> 'a
pop_exn rlist
removes and returns the first element ofrlist
. Unsafe version ofpop
.- raises Failure
if the list is empty.
val create : unit -> 'a t
create ()
creates a new empty reference list.
val clear : _ t -> unit
clear rlist
removes all elements ofrlist
.
val lift : ('a list -> 'b) -> 'a t -> 'b
lift f rlist
applies a list functionf
to the content ofrlist
.
val push_list : 'a t -> 'a list -> unit
push_list rlist l
adds elements of the listl
at the beginning of the list refrlist
. Elements at the end of the listl
will be at the beginning of the list refrlist
.