Regenerate.Make(W)(S)(A)
is a module that implements
sample generation for words implemented by the module W
with the alphabet A
.
S
describes the data structure used internally for the enumeration of
words.
For casual use of the library, consider using arbitrary instead.
val sample : ?st:Random.State.t ‑> ?n:int ‑> ?firsts:int ‑> skip:int ‑> lang ‑> (Segment.elt ‑> unit) ‑> res
sample ~skip ~n lang
returns a sequence of on average n
elements.
lang
is only consumed when needed.
We sample one element every k
, where k
follows a power law of
average skip
. Furthermore, if we consume more than sqrt k
empty segments,
we assume that the rest of the segments will be infinitely empty and
stop.
If firsts
is provided, we always output the firsts
first elements.