Simple implementation of functional queues
type 'a iter = ( 'a -> unit ) -> unittype 'a printer = Stdlib.Format.formatter -> 'a -> unittype 'a gen = unit -> 'a optionQueue containing elements of type 'a
val is_empty : 'a t -> boolval push : 'a -> 'a t -> 'a tPush element at the end of the queue.
val snoc : 'a t -> 'a -> 'a tval peek : 'a t -> 'a optionFirst element of the queue.
val peek_exn : 'a t -> 'aval pop : 'a t -> ('a * 'a t) optionGet and remove the first element.
val pop_exn : 'a t -> 'a * 'a tSame as pop, but fails on empty queues.
Remove first element. If the queue is empty, do nothing.
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.
val map : ( 'a -> 'b ) -> 'a t -> 'b tReverse the queue. Constant time.
val equal : ( 'a -> 'a -> bool ) -> 'a t -> 'a t -> boolmodule Infix : sig ... endinclude module type of Infix
val (>|=) : 'a t -> ( 'a -> 'b ) -> 'b tval (@) : 'a t -> 'a t -> 'a tval (<::) : 'a t -> 'a -> 'a tNumber 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_iter : 'a t -> 'a iterval add_iter : 'a t -> 'a iter -> 'a tval of_iter : 'a iter -> 'a tval to_seq : 'a t -> 'a Stdlib.Seq.tRenamed from to_std_seq since 3.0.
val add_seq : 'a t -> 'a Stdlib.Seq.t -> 'a tRenamed from add_std_seq since 3.0.
val of_seq : 'a Stdlib.Seq.t -> 'a tRenamed from of_std_seq since 3.0.
val of_gen : 'a gen -> 'a tval add_gen : 'a t -> 'a gen -> 'a tval to_gen : 'a t -> 'a genIO