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 tval is_empty : 'a t -> booltrue if a ref list is emptyval clear : 'a t -> unitval length : 'a t -> intval copy : dst:'a t -> src:'a t -> unitval copy_list : dst:'a t -> src:'a list -> unitval copy_enum : dst:'a t -> src:'a Enum.t -> unitval of_list : 'a list -> 'a tval to_list : 'a t -> 'a listval of_enum : 'a Enum.t -> 'a tval enum : 'a t -> 'a Enum.tval add : 'a t -> 'a -> unitval push : 'a t -> 'a -> unitval add_sort : ?cmp:('a -> 'a -> int) -> 'a t -> 'a -> unitval first : 'a t -> 'aEmpty_list if the ref list is emptyval last : 'a t -> 'aval pop : 'a t -> 'aEmpty_list if the ref list is emptyval npop : 'a t -> int -> 'a listEmpty_list if the ref list does not
contain enough elementsval hd : 'a t -> 'afirstval tl : 'a t -> 'a tEmpty_list if the ref list is emptyval rev : 'a t -> unitval iter : ('a -> unit) -> 'a t -> unitval find : ('a -> bool) -> 'a t -> 'aNot_found if no element is foundval rfind : ('a -> bool) -> 'a t -> 'aNot_found if no element is foundval find_exc : ('a -> bool) -> exn -> 'a t -> 'aval exists : ('a -> bool) -> 'a t -> booltrue if an element matches the specified
predicateval for_all : ('a -> bool) -> 'a t -> booltrue if all elements match the specified
predicateval map : ('a -> 'b) -> 'a t -> 'b tval transform : ('a -> 'a) -> 'a t -> unitval map_list : ('a -> 'b) -> 'a t -> 'b listval sort : ?cmp:('a -> 'a -> int) -> 'a t -> unitval filter : ('a -> bool) -> 'a t -> unitval remove : 'a t -> 'a -> unitNot_found if the element is not foundval remove_if : ('a -> bool) -> 'a t -> unitNot_found if no element has been removedval remove_all : 'a t -> 'a -> unitmodule Index:sig..end
ith element of a list.