Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type Key = Int
- type Weight = Int
- type Deficit = Word
- data Precedence = Precedence { }
- newPrecedence :: Weight -> Precedence
-
data
PriorityQueue
a =
PriorityQueue
{
- baseDeficit :: Deficit
- queue :: Heap a
- type Heap a = IntPSQ Precedence a
- empty :: PriorityQueue a
- isEmpty :: PriorityQueue a -> Bool
- enqueue :: Key -> Precedence -> a -> PriorityQueue a -> PriorityQueue a
- dequeue :: PriorityQueue a -> Maybe ( Key , Precedence , a, PriorityQueue a)
- delete :: Key -> PriorityQueue a -> ( Maybe a, PriorityQueue a)
Documentation
data Precedence Source #
Internal representation of priority in priority queues. The precedence of a dequeued entry should be specified to enqueue when the entry is enqueued again.
Instances
Eq Precedence Source # | |
Defined in Network.HTTP2.Priority.PSQ (==) :: Precedence -> Precedence -> Bool Source # (/=) :: Precedence -> Precedence -> Bool Source # |
|
Ord Precedence Source # | |
Defined in Network.HTTP2.Priority.PSQ compare :: Precedence -> Precedence -> Ordering Source # (<) :: Precedence -> Precedence -> Bool Source # (<=) :: Precedence -> Precedence -> Bool Source # (>) :: Precedence -> Precedence -> Bool Source # (>=) :: Precedence -> Precedence -> Bool Source # max :: Precedence -> Precedence -> Precedence Source # min :: Precedence -> Precedence -> Precedence Source # |
|
Show Precedence Source # | |
Defined in Network.HTTP2.Priority.PSQ |
newPrecedence :: Weight -> Precedence Source #
For test only
data PriorityQueue a Source #
PriorityQueue | |
|
type Heap a = IntPSQ Precedence a Source #
empty :: PriorityQueue a Source #
isEmpty :: PriorityQueue a -> Bool Source #
enqueue :: Key -> Precedence -> a -> PriorityQueue a -> PriorityQueue a Source #
dequeue :: PriorityQueue a -> Maybe ( Key , Precedence , a, PriorityQueue a) Source #
delete :: Key -> PriorityQueue a -> ( Maybe a, PriorityQueue a) Source #