Module type Queue_intf.S
An interface for queues that follows Base's conventions, as opposed to OCaml's standard Queue module.
val t_of_sexp : (Base.Sexp.t -> 'a) -> Base.Sexp.t -> 'a tval sexp_of_t : ('a -> Base.Sexp.t) -> 'a t -> Base.Sexp.t
include Base.Indexed_container.S1 with type 'a t := 'a t
val mem : 'a t -> 'a -> equal:('a -> 'a -> bool) -> boolval length : 'a t -> intval is_empty : 'a t -> boolval iter : 'a t -> f:('a -> unit) -> unitval fold : 'a t -> init:'accum -> f:('accum -> 'a -> 'accum) -> 'accumval fold_result : 'a t -> init:'accum -> f:('accum -> 'a -> ('accum, 'e) Base.Result.t) -> ('accum, 'e) Base.Result.tval fold_until : 'a t -> init:'accum -> f:('accum -> 'a -> ('accum, 'final) Base__.Container_intf.Export.Continue_or_stop.t) -> finish:('accum -> 'final) -> 'finalval exists : 'a t -> f:('a -> bool) -> boolval for_all : 'a t -> f:('a -> bool) -> boolval count : 'a t -> f:('a -> bool) -> intval sum : (module Base__.Container_intf.Summable with type t = 'sum) -> 'a t -> f:('a -> 'sum) -> 'sumval find : 'a t -> f:('a -> bool) -> 'a optionval find_map : 'a t -> f:('a -> 'b option) -> 'b optionval to_list : 'a t -> 'a listval to_array : 'a t -> 'a arrayval min_elt : 'a t -> compare:('a -> 'a -> int) -> 'a optionval max_elt : 'a t -> compare:('a -> 'a -> int) -> 'a optionval foldi : 'a t -> init:'b -> f:(int -> 'b -> 'a -> 'b) -> 'bval iteri : 'a t -> f:(int -> 'a -> unit) -> unitval existsi : 'a t -> f:(int -> 'a -> bool) -> boolval for_alli : 'a t -> f:(int -> 'a -> bool) -> boolval counti : 'a t -> f:(int -> 'a -> bool) -> intval findi : 'a t -> f:(int -> 'a -> bool) -> (int * 'a) optionval find_mapi : 'a t -> f:(int -> 'a -> 'b option) -> 'b option
val singleton : 'a -> 'a tsingleton areturns a queue with one element.
val of_list : 'a list -> 'a tof_list listreturns a queuetwith the elements oflistin the same order as the elements oflist(i.e. the first element oftis the first element of the list).
val of_array : 'a array -> 'a tval init : int -> f:(int -> 'a) -> 'a tinit n ~fis equivalent toof_list (List.init n ~f).
val enqueue : 'a t -> 'a -> unitenqueue t aaddsato the end oft.
val enqueue_all : 'a t -> 'a list -> unitenqueue_all t listadds all elements inlisttotin order oflist.
val dequeue : 'a t -> 'a optiondequeue tremoves and returns the front element oft, if any.
val dequeue_exn : 'a t -> 'aval peek : 'a t -> 'a optionpeek treturns but does not remove the front element oft, if any.
val map : 'a t -> f:('a -> 'b) -> 'b tval mapi : 'a t -> f:(int -> 'a -> 'b) -> 'b tval concat_map : 'a t -> f:('a -> 'b list) -> 'b tCreates a new queue with elements equal to
List.concat_map ~f (to_list t).
val concat_mapi : 'a t -> f:(int -> 'a -> 'b list) -> 'b tval filter_map : 'a t -> f:('a -> 'b option) -> 'b tfilter_mapcreates a new queue with elements equal toList.filter_map ~f (to_list t).
val filter_mapi : 'a t -> f:(int -> 'a -> 'b option) -> 'b tval filter : 'a t -> f:('a -> bool) -> 'a tfilteris likefilter_map, except withList.filter.
val filteri : 'a t -> f:(int -> 'a -> bool) -> 'a tval filter_inplace : 'a t -> f:('a -> bool) -> unitfilter_inplace t ~fremoves all elements oftthat don't satisfyf. Iffraises,tis unchanged. This is inplace in that it modifiest; however, it uses space linear in the final length oft.
val filteri_inplace : 'a t -> f:(int -> 'a -> bool) -> unit