module List:sig
..end
val init : int -> (int -> 'a) -> 'a list
val nb_distinct : 'a list -> int
val merge_lists : ('a -> 'a -> int) -> 'a list list -> 'a list
List.merge
, but takes more than only two lists as input.
Assuming that all the lists in l
are sorted according to the comparison function cmp
,
merge_lists cmp l
will return a sorted list containting all the elements of the lists of l
.
Tail-recursive on l
but not on the lists contained in l
since it uses List.merge
.
More efficient than
let merge_lists comp = List.fold_left (List.merge comp) []
.
val max : ('a -> 'a -> bool) -> 'a list -> 'a
val iteri : (int -> 'a -> 'b) -> 'a list -> unit
val dedoublonne : 'a list -> 'a list
val stable_dedoublonne : 'a list -> 'a list
val stable_dedoublonne_fast : 'a list -> 'a list
stable_dedoublonne
on big lists.