Maintainer | Ertugrul Soeylemez <es@ertes.de> |
---|---|
Safe Haskell | Safe-Inferred |
Timed maps for efficient cleanups in the context wires.
- data TimedMap t k a
- findWithDefault :: Ord k => (a, t) -> k -> TimedMap t k a -> (a, t)
- lookup :: Ord k => k -> TimedMap t k a -> Maybe (a, t)
- empty :: TimedMap t k a
- insert :: (Ord k, Ord t) => t -> k -> a -> TimedMap t k a -> TimedMap t k a
- cleanup :: (Ord k, Ord t) => t -> TimedMap t k a -> TimedMap t k a
- cut :: (Ord k, Ord t) => Int -> TimedMap t k a -> TimedMap t k a
- delete :: (Ord k, Ord t) => k -> TimedMap t k a -> TimedMap t k a
Timed maps
A timed map is a map with an additional index based on time.
Queries
findWithDefault :: Ord k => (a, t) -> k -> TimedMap t k a -> (a, t)Source
Like lookup
, but with a default value, if the key is not in the
map.
Construction
Insertion
insert :: (Ord k, Ord t) => t -> k -> a -> TimedMap t k a -> TimedMap t k aSource
Insert into the timed map.
Deletion
cleanup :: (Ord k, Ord t) => t -> TimedMap t k a -> TimedMap t k aSource
Remove all elements older than the given time.