MutPriorityQueue
struct MutPriorityQueue[a: Type, r: Eff]Sourcer: Region[r]mut values: Array[a, r]mut size: Int32Type of mutable priority queues.
Explanation of component types (left to right): Component 1: The region capability the queue is associated with. Component 2: A reference to the backing array. Component 3: A reference to the number of elements in the mutable priority queue.
The maximum element (if it exists) can always be accessed in constant time.
Type of mutable priority queues, and its functions.
Instances
instance Formattable[MutPriorityQueue[a, r]] with Formattable[a], Order[a]Sourcetype Aef = Aef[a] + rDefinitions
Removes and optionally returns the top element of mq.
Returns an empty MutPriorityQueue with a default capacity.
Returns an empty MutPriorityQueue with the given capacity rounded up to the default capacity.
Enqueues an element x into a mq.
def enqueueAll(m: m, mq: MutPriorityQueue[elt, r]): Unit \ r + Aef[m] with ForEach[m], Order[elt] where ForEach.Elm[m] ~ elt§ SourceEnqueues each element in m into mq.
Applies f to every element of q.
def iterator(rc: Region[r1], mq: MutPriorityQueue[a, r2]): Iterator[a, r1 + r2, r1] \ r1 + r2§ SourceReturns an iterator over mq.
Modifying mq during iteration is undefined and not recommended.
Optionally returns the top element of mq.
Returns an Array representation of mq.
Note that a MutPriorityQueue's element order depends on the order in which the elements were enqueued.
Returns a List representation of mq.
Note that a MutPriorityQueue's element order depends on the order in which the elements were enqueued.
Optionally returns a Nel representation of mq.
Returns a String representation of the mutable priority queue mq.