NextListinclude module type of Stdlib.ListReturns the union of two sorted lists seen as sets. union_sorted cmp l1 l2 is equivalent to sort_uniq cmp (l1 @ l2) except faster.
Returns the intersection of two sorted lists seen as sets. inter_sorted cmp l1 l2 is equivalent to filter (fun x1 -> exists (fun x2 -> cmp x1 x2 = 0) l2) l1 except much faster.
Returns the difference of two sorted lists seen as sets. diff_sorted cmp l1 l2 is equivalent to filter (fun x1 -> not (exists (fun x2 -> cmp x1 x2 = 0) l2)) l1 except much faster.
Returns the symmetric difference of two sorted lists seen as sets. symdiff_sorted cmp l1 l2 is equivalent to union_sorted (diff_sorted l1 l2) (diff_sorted l2 l1) except faster.
hdn n l returns the n first elements of l in a list. If n is bigger than the size of l, returns l.
init_until f initialises a list by calling f until it returns None.
sub l pos len is a list of length len, containing the sublist of l that starts at position pos and has length len.
take n l returns the prefix of l of length n. It is the same as sub l 0 n. For all n between 0 and length l, l = take n l @ drop n l.
drop n l returns the suffix of l after the n first elements. It is the same as sub l n (length l - n). For all n between 0 and length l, l = take n l @ drop n l.