b0.memo
B0_random_queue
Random queue
ocaml
b0
opam
b0 test
b0.file
b0.kit
b0.std
b0.tool
type 'a t
The type for random queues with elements of type 'a.
'a
val empty : ?rand:Random.State.t -> unit -> 'a t
emtpy ~rand () is an empty random queue using rand as random state (defaults to Random.State.make_self_init).
emtpy ~rand ()
rand
Random.State.make_self_init
val add : 'a t -> 'a -> unit
add q v adds v to the queue.
add q v
v
val take : 'a t -> 'a option
take q removes and returns a random element in q (if any).
take q
q
val length : 'a t -> int
length q is the number of elements in q.
length q