package ke
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Module type Sigs.RSource
Raised when peek_exn, pop_exn, N.keep_exn or N.shift_exn is applied to an empty queue.
val is_empty : ('a, 'b) t -> boolReturn true if the given queue is empty, false otherwise.
val create : ?capacity:int -> ('a, 'b) Bigarray_compat.kind -> ('a, 'b) tReturn a new queue, initially empty.
val capacity : ('a, 'b) t -> intReturns how many objects t can store.
val length : ('a, 'b) t -> intNumber of elements in the queue.
val push : ('a, 'b) t -> 'a -> unitpush q x adds the elements x at the end of the queue q.
val pop : ('a, 'b) t -> 'a optionpop q removes and returns the first element in queue q. If q is empty, it returns None.
val pop_exn : ('a, 'b) t -> 'aval peek : ('a, 'b) t -> 'a optionpeek q returns the first element in the queue q, without removing it from the queue. If q is empty, it returns None.
val cons : ('a, 'b) t -> 'a -> unitcons q x adds element x at the front of the given queue q. It returns None if it fails.
val clear : ('a, 'b) t -> unitDiscard all elements from a queue.
val compress : ('a, 'b) t -> unitmodule N : sig ... endval iter : ('a -> unit) -> ('a, 'b) t -> unititer f q applies f in turn to all elements of q, from the least recently entered to the most recently entered. The queue itself is unchanged.
val rev_iter : ('a -> unit) -> ('a, 'b) t -> unititer f q applies f in turn to all elements of q, from the most recently entered to the least recently entered. The queue itself is unchanged.
val fold : ('acc -> 'x -> 'acc) -> 'acc -> ('x, 'b) t -> 'accfold f a q is equivalent to List.fold_left f a l, where l is the list of q's elements. The queue remains unchanged.