val nil : 'a tval empty : 'a tval singleton : 'a ‑> 'a tval repeat : ?n:int ‑> 'a ‑> 'a trepeat ~n x repeats xn times then stops. If n is omitted,
then x is repeated forever.
val unfold : ('b ‑> ('a * 'b) option) ‑> 'b ‑> 'a tunfold f acc calls f acc and:
f acc = Some (x, acc'), yield x, continue with unfold f acc'.f acc = None, stops.val is_empty : 'a t ‑> boolUnsafe version of tail.
val iter : ('a ‑> unit) ‑> 'a t ‑> unitval length : _ t ‑> intNumber of elements in the list. Will not terminate if the list if infinite: use (for instance) take to make the list finite if necessary.
Fair product of two (possibly infinite) lists into a new list. Lazy. The first parameter is used to combine each pair of elements.
Specialization of product_with producing tuples.
group eq l groups together consecutive elements that satisfy eq. Lazy.
For instance group (=) [1;1;1;2;2;3;3;1] yields
[1;1;1]; [2;2]; [3;3]; [1].
uniq eq l returns l but removes consecutive duplicates. Lazy.
In other words, if several values that are equal follow one another,
only the first of them is kept.
val range : int ‑> int ‑> int tval (--) : int ‑> int ‑> int ta -- b is the range of integers containing
a and b (therefore, never empty).
val (--^) : int ‑> int ‑> int ta -- b is the integer range from a to b, where b is excluded.
Eager sort that removes duplicate values. Require the iterator to be
finite. O(n ln(n)) time and space.
val return : 'a ‑> 'a tval pure : 'a ‑> 'a tmodule Infix : sig ... endval of_list : 'a list ‑> 'a t