Primus.GeneratorValue generators.
type t = generatorval sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.tval of_iterator :
?width:int ->
?seed:(int -> 'a) ->
to_bitvec:('d -> Bitvec.t) ->
(module Iterator.Infinite with type dom = 'd and type t = 'a) ->
'a ->
tof_iterator iter init creates a generator from a generic iterator.
The generic iterator iter may use any type as its domain (as long as it provides the projection to Bitvec.t). The type of the generator state is also abstract.
val create :
?width:int ->
(module Iterator.Infinite with type dom = int and type t = 'a) ->
'a ->
tcreate (module Iterator) seed creates a integer generator from the provided Iterator, and initializes it with the given seed.
val static : ?width:int -> int -> tstatic value returns a generator that always produces the same value.
val unfold :
?width:int ->
?min:int ->
?max:int ->
?seed:int ->
f:(('a * int) -> 'a * int) ->
'a ->
tunfold ~min ~max ~seed ~f creates a generator that generates values by applying a function f to a pair of a generator state and previous value.
val width : t -> intwidth the size in bits of the generated words.
module Random : sig ... endRandom Number Generators