package ke
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Module Rke.Weighted
Source
The type of queues containing elements of type 'a
.
Raised when push_exn
or N.push_exn
is applied to an empty queue.
Return a new queue, initially empty with the real capacity of it.
push_exn q x
adds the elements x
at the end of the queue q
. It raises Full
if the given queue q
is full.
push q x
is the same as push_exn
but returns None
if it fails.
pop q
removes and returns the first element in the given queue q
. If q
is empty, it returns None
.
peek q
returns the first element in the given queue q
. If q
is empty, it returns None
.
peek_exn q
returns the first element in the given queue q
. If q
is empty, it raises Empty
.
cons_exn q x
adds element x
at the front of the given queue q
. It raises Full
if the queue is full.
cons q x
adds element x
at the front of the given queue q
. It returns None
if it fails.
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.
iter 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.
fold 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.
/ *