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 |
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 |
length
: 'h t -> int |
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.