Copyright | (c) Galois Inc 2019-2020 |
---|---|
License | BSD3 |
Maintainer | huffman@galois.com |
Safe Haskell | Safe |
Language | Haskell2010 |
A finite map data structure with monoidal annotations.
Documentation
data AnnotatedMap k v a Source #
Instances
(Ord k, Semigroup v) => Functor (AnnotatedMap k v) Source # | |
Defined in What4.Utils.AnnotatedMap fmap :: (a -> b) -> AnnotatedMap k v a -> AnnotatedMap k v b # (<$) :: a -> AnnotatedMap k v b -> AnnotatedMap k v a # | |
(Ord k, Semigroup v) => Foldable (AnnotatedMap k v) Source # | |
Defined in What4.Utils.AnnotatedMap fold :: Monoid m => AnnotatedMap k v m -> m # foldMap :: Monoid m => (a -> m) -> AnnotatedMap k v a -> m # foldr :: (a -> b -> b) -> b -> AnnotatedMap k v a -> b # foldr' :: (a -> b -> b) -> b -> AnnotatedMap k v a -> b # foldl :: (b -> a -> b) -> b -> AnnotatedMap k v a -> b # foldl' :: (b -> a -> b) -> b -> AnnotatedMap k v a -> b # foldr1 :: (a -> a -> a) -> AnnotatedMap k v a -> a # foldl1 :: (a -> a -> a) -> AnnotatedMap k v a -> a # toList :: AnnotatedMap k v a -> [a] # null :: AnnotatedMap k v a -> Bool # length :: AnnotatedMap k v a -> Int # elem :: Eq a => a -> AnnotatedMap k v a -> Bool # maximum :: Ord a => AnnotatedMap k v a -> a # minimum :: Ord a => AnnotatedMap k v a -> a # sum :: Num a => AnnotatedMap k v a -> a # product :: Num a => AnnotatedMap k v a -> a # | |
(Ord k, Semigroup v) => Traversable (AnnotatedMap k v) Source # | |
Defined in What4.Utils.AnnotatedMap traverse :: Applicative f => (a -> f b) -> AnnotatedMap k v a -> f (AnnotatedMap k v b) # sequenceA :: Applicative f => AnnotatedMap k v (f a) -> f (AnnotatedMap k v a) # mapM :: Monad m => (a -> m b) -> AnnotatedMap k v a -> m (AnnotatedMap k v b) # sequence :: Monad m => AnnotatedMap k v (m a) -> m (AnnotatedMap k v a) # |
null :: AnnotatedMap k v a -> Bool Source #
delete :: (Ord k, Semigroup v) => k -> AnnotatedMap k v a -> AnnotatedMap k v a Source #
annotation :: (Ord k, Semigroup v) => AnnotatedMap k v a -> Maybe v Source #
toList :: AnnotatedMap k v a -> [(k, a)] Source #
fromAscList :: (Ord k, Semigroup v) => [(k, v, a)] -> AnnotatedMap k v a Source #
insert :: (Ord k, Semigroup v) => k -> v -> a -> AnnotatedMap k v a -> AnnotatedMap k v a Source #
alter :: (Ord k, Semigroup v) => (Maybe (v, a) -> Maybe (v, a)) -> k -> AnnotatedMap k v a -> AnnotatedMap k v a Source #
alterF :: (Functor f, Ord k, Semigroup v) => (Maybe (v, a) -> f (Maybe (v, a))) -> k -> AnnotatedMap k v a -> f (AnnotatedMap k v a) Source #
union :: (Ord k, Semigroup v) => AnnotatedMap k v a -> AnnotatedMap k v a -> AnnotatedMap k v a Source #
unionWith :: (Ord k, Semigroup v) => ((v, a) -> (v, a) -> (v, a)) -> AnnotatedMap k v a -> AnnotatedMap k v a -> AnnotatedMap k v a Source #
unionWithKeyMaybe :: (Ord k, Semigroup v) => (k -> a -> a -> Maybe (v, a)) -> AnnotatedMap k v a -> AnnotatedMap k v a -> AnnotatedMap k v a Source #
filter :: (Ord k, Semigroup v) => (a -> Bool) -> AnnotatedMap k v a -> AnnotatedMap k v a Source #
mapMaybe :: (Ord k, Semigroup v) => (a -> Maybe b) -> AnnotatedMap k v a -> AnnotatedMap k v b Source #
traverseMaybeWithKey :: (Applicative f, Ord k, Semigroup v1, Semigroup v2) => (k -> v1 -> a1 -> f (Maybe (v2, a2))) -> AnnotatedMap k v1 a1 -> f (AnnotatedMap k v2 a2) Source #
difference :: (Ord k, Semigroup v, Semigroup w) => AnnotatedMap k v a -> AnnotatedMap k w b -> AnnotatedMap k v a Source #
:: (Ord k, Semigroup u, Semigroup v, Semigroup w) | |
=> (k -> (u, a) -> (v, b) -> Maybe (w, c)) | for keys present in both maps |
-> (AnnotatedMap k u a -> AnnotatedMap k w c) | for subtrees only in first map |
-> (AnnotatedMap k v b -> AnnotatedMap k w c) | for subtrees only in second map |
-> AnnotatedMap k u a | |
-> AnnotatedMap k v b | |
-> AnnotatedMap k w c |
mergeWithKeyM :: (Ord k, Semigroup u, Semigroup v, Semigroup w, Applicative m) => (k -> (u, a) -> (v, b) -> m (w, c)) -> (k -> (u, a) -> m (w, c)) -> (k -> (v, b) -> m (w, c)) -> AnnotatedMap k u a -> AnnotatedMap k v b -> m (AnnotatedMap k w c) Source #
mergeA :: (Ord k, Semigroup v, Applicative f) => (k -> (v, a) -> (v, a) -> f (v, a)) -> AnnotatedMap k v a -> AnnotatedMap k v a -> f (AnnotatedMap k v a) Source #
eqBy :: Eq k => (a -> a -> Bool) -> AnnotatedMap k v a -> AnnotatedMap k v a -> Bool Source #