Copyright | (c) Eric Mertens 2018 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Priority queue with Int
priorities returning smallest priority first.
Documentation
Priority queue. No guarantees are made regarding the order entries with the same priority are returned in.
pattern Empty :: PQueue a | Empty priority queue |
pattern (:<|) :: a -> PQueue a -> PQueue a | Pattern for extracting an element with the minimum priority
from the queue. See also: |
Instances
Foldable PQueue Source # | |
Defined in Advent.PQueue fold :: Monoid m => PQueue m -> m # foldMap :: Monoid m => (a -> m) -> PQueue a -> m # foldMap' :: Monoid m => (a -> m) -> PQueue a -> m # foldr :: (a -> b -> b) -> b -> PQueue a -> b # foldr' :: (a -> b -> b) -> b -> PQueue a -> b # foldl :: (b -> a -> b) -> b -> PQueue a -> b # foldl' :: (b -> a -> b) -> b -> PQueue a -> b # foldr1 :: (a -> a -> a) -> PQueue a -> a # foldl1 :: (a -> a -> a) -> PQueue a -> a # elem :: Eq a => a -> PQueue a -> Bool # maximum :: Ord a => PQueue a -> a # minimum :: Ord a => PQueue a -> a # | |
Traversable PQueue Source # | |
Functor PQueue Source # | |
Read a => Read (PQueue a) Source # | |
Show a => Show (PQueue a) Source # |
|
Construction
Construct a priority queue from a single priority and value.
fromList :: [(Int, a)] -> PQueue a Source #
Construct a priority queue from a list of priorities and values.
Insertion
Insert a new value into the queue given a priority.