Module Queue


module Queue = struct ... end 
Types
'b t The type of queues containing elements of type 'a.
Abstract

Exceptions
Empty Raised when take is applied to an empty queue.

Functions

create : unit -> 'c t
Return a new queue, initially empty.

add : 'd -> 'd t -> unit
add x q adds the element x at the end of the queue q.

take : 'e t -> 'e
take q removes and returns the first element in queue q, or raises Empty if the queue is empty.

peek : 'f t -> 'f
peek q returns the first element in queue q, without removing it from the queue, or raises Empty if the queue is empty.

clear : 'g t -> unit
Discard all elements from a queue.

length : 'h t -> int
Return the number of elements in a queue.

iter : f:('i -> unit) -> 'i t -> unit
iter 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.