Module type Fsq.S
Signature of fixed-size search queues.
type k
Keys in
t
.
val empty : int -> t
empty max_size
is the search queue withmax_size
that contains no elements.
val size : t -> int
size t
is the number of distinct elements int
.
val push : k -> t -> t
push k t
ist
withk
added to the queue. If the queue reachedmax_size
, the oldest element ispop
ped from the queue. Ifk
already exists int
, no operation is performed
val fold : (k -> int -> 'a -> 'a) -> 'a -> t -> 'a
fold f z t
isf k0 p0 (f k1 p1 ... (f kn pn z))
. Elements are folded over in insertion order where p is the index of the element starting from 0.