module RefList:Reference on lists.sig
..end
RefList is a extended set of functions that manipulate list
references.
exception Empty_list
exception Invalid_index of int
type 'a
t
val empty : unit -> 'a t
val is_empty : 'a t -> bool
true
if a ref list is emptyval clear : 'a t -> unit
val length : 'a t -> int
val copy : dst:'a t -> src:'a t -> unit
val copy_list : dst:'a t -> src:'a list -> unit
val copy_enum : dst:'a t -> src:'a Enum.t -> unit
val of_list : 'a list -> 'a t
val to_list : 'a t -> 'a list
val of_enum : 'a Enum.t -> 'a t
val enum : 'a t -> 'a Enum.t
val add : 'a t -> 'a -> unit
val push : 'a t -> 'a -> unit
val add_sort : ?cmp:('a -> 'a -> int) -> 'a t -> 'a -> unit
val first : 'a t -> 'a
Empty_list
if the ref list is emptyval last : 'a t -> 'a
val pop : 'a t -> 'a
Empty_list
if the ref list is emptyval npop : 'a t -> int -> 'a list
Empty_list
if the ref list does not
contain enough elementsval hd : 'a t -> 'a
first
val tl : 'a t -> 'a t
Empty_list
if the ref list is emptyval rev : 'a t -> unit
val iter : ('a -> unit) -> 'a t -> unit
val find : ('a -> bool) -> 'a t -> 'a
Not_found
if no element is foundval rfind : ('a -> bool) -> 'a t -> 'a
Not_found
if no element is foundval find_exc : ('a -> bool) -> exn -> 'a t -> 'a
val exists : ('a -> bool) -> 'a t -> bool
true
if an element matches the specified
predicateval for_all : ('a -> bool) -> 'a t -> bool
true
if all elements match the specified
predicateval map : ('a -> 'b) -> 'a t -> 'b t
val transform : ('a -> 'a) -> 'a t -> unit
val map_list : ('a -> 'b) -> 'a t -> 'b list
val sort : ?cmp:('a -> 'a -> int) -> 'a t -> unit
val filter : ('a -> bool) -> 'a t -> unit
val remove : 'a t -> 'a -> unit
Not_found
if the element is not foundval remove_if : ('a -> bool) -> 'a t -> unit
Not_found
if no element has been removedval remove_all : 'a t -> 'a -> unit
module Index:sig
..end
i
th element of a list.