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 # (/=) :: Precedence -> Precedence -> Bool # | |
Ord Precedence Source # | |
Defined in Network.HTTP2.Priority.PSQ compare :: Precedence -> Precedence -> Ordering # (<) :: Precedence -> Precedence -> Bool # (<=) :: Precedence -> Precedence -> Bool # (>) :: Precedence -> Precedence -> Bool # (>=) :: Precedence -> Precedence -> Bool # max :: Precedence -> Precedence -> Precedence # min :: Precedence -> Precedence -> Precedence # | |
Show Precedence Source # | |
Defined in Network.HTTP2.Priority.PSQ showsPrec :: Int -> Precedence -> ShowS # show :: Precedence -> String # showList :: [Precedence] -> ShowS # |
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 #