Copyright | Copyright (c) 2009-2014, David Sorokin <david.sorokin@gmail.com> |
---|---|
License | BSD3 |
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Tested with: GHC 7.8.3
An imperative heap-based priority queue.
- data PriorityQueue m a
- queueNull :: ProtoMonadComp m => PriorityQueue m a -> m Bool
- queueCount :: ProtoMonadComp m => PriorityQueue m a -> m Int
- newQueue :: ProtoMonadComp m => Session m -> m (PriorityQueue m a)
- enqueue :: ProtoMonadComp m => PriorityQueue m a -> Double -> a -> m ()
- dequeue :: ProtoMonadComp m => PriorityQueue m a -> m ()
- queueFront :: ProtoMonadComp m => PriorityQueue m a -> m (Double, a)
Documentation
data PriorityQueue m a Source
The PriorityQueue
type represents an imperative heap-based
priority queue.
queueNull :: ProtoMonadComp m => PriorityQueue m a -> m Bool Source
Test whether the priority queue is empty.
queueCount :: ProtoMonadComp m => PriorityQueue m a -> m Int Source
Return the number of elements in the priority queue.
newQueue :: ProtoMonadComp m => Session m -> m (PriorityQueue m a) Source
Create a new priority queue.
enqueue :: ProtoMonadComp m => PriorityQueue m a -> Double -> a -> m () Source
Enqueue a new element with the specified priority.
dequeue :: ProtoMonadComp m => PriorityQueue m a -> m () Source
Dequeue the element with the minimal priority.
queueFront :: ProtoMonadComp m => PriorityQueue m a -> m (Double, a) Source
Return the element with the minimal priority.