module List:sig..end
val is_empty : 'a list -> booltrue if the list is empty, otherwise returns false.val find' : ('a -> bool) -> 'a list -> 'a optionval take : int -> 'a list -> 'a listval select : ('a -> bool) -> 'a list -> 'a list * 'a listselect pred l returns a pair containing as the first component the longest
prefix p of l, such that all elements of p satisfies pred.
The second component q contains all forthcoming elements of l, such that
p @ q = l. So the first element of q does not satisfy the pred.val mem_cmp : ('a -> 'a -> bool) -> 'a -> 'a list -> boolmem_cmp cmp a l checks if a is element of the list, and uses
cmp as compare operator.val mapi : (int -> 'a -> 'b) -> 'a list -> 'b listmapi f l applies f to each element of the list and also
gives the position of the list element as first parameter.val compare : ('a -> 'a -> int) -> 'a list -> 'a list -> intval compare_ignore_order : ?equal:('a -> 'a -> bool) -> 'a list -> 'a list -> boolcompare_ignore_order ~equal:eq l1 l2 returns true if the two lists l1
and l2 has the same elements. The order of the elements is ignored. As a
comparison function is eq used if given. If the parameter is not set the
default will be Pervasives.compare.val maybe_forall : ('a -> bool option) -> 'a list -> bool optionmaybe_forall f l returns Some true if f e == Some true
for all elements e of l. If there exists one e in l
such that f e == Some false then Some false is the result
of maybe_forall f l. If no application of f to the elements
results in Some false, but some returns None, then None
is returned.
If the element with number i returns Some false then
f (take j l) for i < j < length l is not evaluated.
val maybe_exists : ('a -> bool option) -> 'a list -> bool optionmaybe_exists f l returns Some true if f e == Some true
for at least one element e of l. If for all e in l
it holds that f e == Some false then Some false is the result
of maybe_forall f l. If no application of f to the elements
results in Some True, but some returns None, then None
is returned.
If the element with number i returns Some True then
f (take j l) for i < j < length l is not evaluated.
val subset : ?equal:('a -> 'a -> bool) -> 'a list -> 'a list -> booltrue if the first list is a subset of the second one.val add : 'a -> 'a list -> 'a listval remove : 'a -> 'a list -> 'a listremove elm set returns the set that do not contain elm.val union : 'a list -> 'a list -> 'a listval inter : 'a list -> 'a list -> 'a listinter l1 l2 contains the intersection of the two sets l1
and l2.val diff : 'a list -> 'a list -> 'a listdiff l1 l2 contains all elements of l1 that are
not part of l2 if l1, l2 as sets.val assoc' : ?equal:('a -> 'a -> bool) -> 'a -> ('a * 'b) list -> 'b optionassoc' a l == Some b iff assoc a l == b. If
assoc a l -> throws Not_found, then assoc' a l == None.val length : 'a list -> intval hd : 'a list -> 'aval tl : 'a list -> 'a listval nth : 'a list -> int -> 'aval rev : 'a list -> 'a listval append : 'a list -> 'a list -> 'a listval rev_append : 'a list -> 'a list -> 'a listval concat : 'a list list -> 'a listval flatten : 'a list list -> 'a listval iter : ('a -> unit) -> 'a list -> unitval map : ('a -> 'b) -> 'a list -> 'b listval rev_map : ('a -> 'b) -> 'a list -> 'b listval fold_left : ('a -> 'b -> 'a) -> 'a -> 'b list -> 'aval fold_right : ('a -> 'b -> 'b) -> 'a list -> 'b -> 'bval iter2 : ('a -> 'b -> unit) -> 'a list -> 'b list -> unitval map2 : ('a -> 'b -> 'c) -> 'a list -> 'b list -> 'c listval rev_map2 : ('a -> 'b -> 'c) -> 'a list -> 'b list -> 'c listval fold_left2 : ('a -> 'b -> 'c -> 'a) -> 'a -> 'b list -> 'c list -> 'aval fold_right2 : ('a -> 'b -> 'c -> 'c) -> 'a list -> 'b list -> 'c -> 'cval for_all : ('a -> bool) -> 'a list -> boolval exists : ('a -> bool) -> 'a list -> boolval for_all2 : ('a -> 'b -> bool) -> 'a list -> 'b list -> boolval exists2 : ('a -> 'b -> bool) -> 'a list -> 'b list -> boolval mem : 'a -> 'a list -> boolval memq : 'a -> 'a list -> boolval find : ('a -> bool) -> 'a list -> 'aval filter : ('a -> bool) -> 'a list -> 'a listval find_all : ('a -> bool) -> 'a list -> 'a listval partition : ('a -> bool) -> 'a list -> 'a list * 'a listval assoc : 'a -> ('a * 'b) list -> 'bval assq : 'a -> ('a * 'b) list -> 'bval mem_assoc : 'a -> ('a * 'b) list -> boolval mem_assq : 'a -> ('a * 'b) list -> boolval remove_assoc : 'a -> ('a * 'b) list -> ('a * 'b) listval remove_assq : 'a -> ('a * 'b) list -> ('a * 'b) listval split : ('a * 'b) list -> 'a list * 'b listval combine : 'a list -> 'b list -> ('a * 'b) listval sort : ('a -> 'a -> int) -> 'a list -> 'a listval stable_sort : ('a -> 'a -> int) -> 'a list -> 'a listval fast_sort : ('a -> 'a -> int) -> 'a list -> 'a listval merge : ('a -> 'a -> int) -> 'a list -> 'a list -> 'a list