Module CCSimple_queue
Functional queues (fifo)
type 'a sequence= ('a -> unit) -> unittype 'a printer= Format.formatter -> 'a -> unittype 'a klist= unit -> [ `Nil | `Cons of 'a * 'a klist ]type 'a gen= unit -> 'a optiontype +'a tQueue containing elements of type 'a
val empty : 'a tval is_empty : 'a t -> boolval push : 'a -> 'a t -> 'a tPush element at the end of the queue.
val peek : 'a t -> 'a optionFirst element of the queue.
val pop_exn : 'a t -> 'a * 'a tSame as
pop, but fails on empty queues.- raises Invalid_argument
if the queue is empty.
val append : 'a t -> 'a t -> 'a tAppend two queues. Elements from the second one come after elements of the first one. Linear in the size of the second queue.
module Infix : sig ... endval length : 'a t -> intNumber of elements in the queue (linear in time).
val fold : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'bval iter : ('a -> unit) -> 'a t -> unitval to_list : 'a t -> 'a listval add_list : 'a t -> 'a list -> 'a tval of_list : 'a list -> 'a tval to_seq : 'a t -> 'a sequenceval add_seq : 'a t -> 'a sequence -> 'a tval of_seq : 'a sequence -> 'a tval to_klist : 'a t -> 'a klistval add_klist : 'a t -> 'a klist -> 'a tval of_klist : 'a klist -> 'a tval of_gen : 'a gen -> 'a tval add_gen : 'a t -> 'a gen -> 'a tval to_gen : 'a t -> 'a gen