module List_util:Utility functions for lists.sig
..end
module Hashed_list:
val count : ('a -> bool) -> 'a list -> int
count p l
is the number of elements in l
for which p
holds.
count p l >= 0
val exists_unique : ('a -> bool) -> 'a list -> bool
exists_unique p l
holds when p
for exactly one element of l
.
exists_unique p l = (count p l = 1)
val remove_sorted_duplicates : ('a -> 'a -> int) -> 'a list -> 'a list
val iter_pairwise : ('a -> 'a -> unit) -> 'a list -> unit
iter_pairwise f l
applies f
to all pairs (a,b)
such
that a
occurs in l
and b
occurs after a
in l
.val find_index : ('a -> bool) -> 'a list -> int
find_index p l
is the index of the first element in l
that
satisfies p
.
Not_found
if no element in l
satisfies p
val pp_print_list : (Format.formatter -> 'a -> unit) ->
(Format.formatter -> unit -> unit) -> Format.formatter -> 'a list -> unit
pp_print_list
pe ps f [e0; e1; ... en]
performs pe f e0; ps f (); pe f e1;
ps f (); ... pe f en
.