|
Inserts a single element into the queue. The default implementation uses merge and singleton.
|
|
insertAll :: [e] -> q -> q | Source |
|
Inserts several elements into the queue. The default implementation uses insert. (In some cases, it may be advantageous to override this implementation with xs `insertAll` q = q `merge` fromList xs.)
|
|
|
Attempts to extract an element from the queue; if the queue is empty, returns Nothing. The default implementation uses peek and delete.
|
|
|
Gets the element that will next be extracted from the queue, if there is an element available. The default implementation uses extract.
|
|
|
Deletes an element from the queue, if the queue is nonempty. The default implementation uses extract.
|
|
|
Constructs an empty queue. The default implementation uses fromList.
|
|
|
Constructs a queue with a single element. The default implementation uses insert and empty.
|
|
|
Constructs a queue with all of the elements in the list. The default implementation uses insertAll and empty.
|
|
|
Gets the size of the queue. The default implementation uses toList_.
|
|
|
Checks if the queue is empty. The default implementation uses peek.
|
|
|
Extracts every element from the queue. The default implementation uses extract.
|
|
|
Extracts every element from the queue, with no guarantees upon order. The default implementation uses toList.
|
|
|
Merges two queues so that the contents of the second queue are inserted into the first queue in extraction order. The default implementation uses toList and insertAll.
|