Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Map g k a
- new :: g -> Map g k a
- generation :: Map g k a -> g
- newGen :: (Ord k, Ord g) => g -> Map g k a -> Map g k a
- insert :: (Ord k, Ord g) => g -> k -> a -> Map g k a -> Map g k a
- delete :: (Ord k, Ord g) => k -> Map g k a -> Map g k a
- lookup :: (Ord k, Ord g) => k -> Map g k a -> Maybe a
- updateLookupWithKey :: (Ord g, Ord k) => g -> (k -> a -> Maybe a) -> k -> Map g k a -> (Maybe a, Map g k a)
- assocs :: Ord g => Map g k a -> [(k, a)]
- inspect :: Ord k => Map g k a -> (Int, g, Int)
Documentation
A map of values that expire after a given generation.
Instances
Ord g => Foldable (Map g k) Source # | |
Defined in Data.Map.Strict.Expiring fold :: Monoid m => Map g k m -> m # foldMap :: Monoid m => (a -> m) -> Map g k a -> m # foldMap' :: Monoid m => (a -> m) -> Map g k a -> m # foldr :: (a -> b -> b) -> b -> Map g k a -> b # foldr' :: (a -> b -> b) -> b -> Map g k a -> b # foldl :: (b -> a -> b) -> b -> Map g k a -> b # foldl' :: (b -> a -> b) -> b -> Map g k a -> b # foldr1 :: (a -> a -> a) -> Map g k a -> a # foldl1 :: (a -> a -> a) -> Map g k a -> a # elem :: Eq a => a -> Map g k a -> Bool # maximum :: Ord a => Map g k a -> a # minimum :: Ord a => Map g k a -> a # | |
Functor (Map g k) Source # | |
(Ord a, Ord g, Ord k) => Semigroup (Map g k a) Source # | |
(Show k, Show a, Show g) => Show (Map g k a) Source # | |
generation :: Map g k a -> g Source #
The current generation
newGen :: (Ord k, Ord g) => g -> Map g k a -> Map g k a Source #
𝑂(log𝑛). Assign the next generation and expire any data this new generation invalidates. +
Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Map g k a
- new :: g -> Map g k a
- generation :: Map g k a -> g
- newGen :: (Ord k, Ord g) => g -> Map g k a -> Map g k a
- insert :: (Ord k, Ord g) => g -> k -> a -> Map g k a -> Map g k a
- delete :: (Ord k, Ord g) => k -> Map g k a -> Map g k a
- lookup :: (Ord k, Ord g) => k -> Map g k a -> Maybe a
- updateLookupWithKey :: (Ord g, Ord k) => g -> (k -> a -> Maybe a) -> k -> Map g k a -> (Maybe a, Map g k a)
- assocs :: Ord g => Map g k a -> [(k, a)]
- inspect :: Ord k => Map g k a -> (Int, g, Int)
Documentation
A map of values that expire after a given generation.
Instances
Ord g => Foldable (Map g k) Source # | |
Defined in Data.Map.Strict.Expiring fold :: Monoid m => Map g k m -> m # foldMap :: Monoid m => (a -> m) -> Map g k a -> m # foldMap' :: Monoid m => (a -> m) -> Map g k a -> m # foldr :: (a -> b -> b) -> b -> Map g k a -> b # foldr' :: (a -> b -> b) -> b -> Map g k a -> b # foldl :: (b -> a -> b) -> b -> Map g k a -> b # foldl' :: (b -> a -> b) -> b -> Map g k a -> b # foldr1 :: (a -> a -> a) -> Map g k a -> a # foldl1 :: (a -> a -> a) -> Map g k a -> a # elem :: Eq a => a -> Map g k a -> Bool # maximum :: Ord a => Map g k a -> a # minimum :: Ord a => Map g k a -> a # | |
Functor (Map g k) Source # | |
(Show k, Show a, Show g) => Show (Map g k a) Source # | |
generation :: Map g k a -> g Source #
The current generation
newGen :: (Ord k, Ord g) => g -> Map g k a -> Map g k a Source #
𝑂(log𝑛). Assign the next generation and expire any data this new generation invalidates. The generation may never decrease. Attempts to decrease it are ignored.
insert :: (Ord k, Ord g) => g -> k -> a -> Map g k a -> Map g k a Source #
𝑂(log𝑛). Insert a new value into the map to expire after the given generation.
lookup :: (Ord k, Ord g) => k -> Map g k a -> Maybe a Source #
𝑂(log𝑛). Lookup a value in the map. This will not return any items that have expired.
updateLookupWithKey :: (Ord g, Ord k) => g -> (k -> a -> Maybe a) -> k -> Map g k a -> (Maybe a, Map g k a) Source #
𝑂(log𝑛). Lookup and update. The function returns changed value, if it is updated. Returns the original key value if the map entry is deleted.