Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Synopsis
- data OMap k v
- empty :: OMap k v
- singleton :: (k, v) -> OMap k v
- (<|) :: Ord k => (,) k v -> OMap k v -> OMap k v
- (|<) :: Ord k => (,) k v -> OMap k v -> OMap k v
- (>|) :: Ord k => OMap k v -> (,) k v -> OMap k v
- (|>) :: Ord k => OMap k v -> (,) k v -> OMap k v
- delete :: Ord k => k -> OMap k v -> OMap k v
- filter :: Ord k => (k -> v -> Bool) -> OMap k v -> OMap k v
- (\\) :: Ord k => OMap k v -> OMap k v' -> OMap k v
- null :: OMap k v -> Bool
- size :: OMap k v -> Int
- member :: Ord k => k -> OMap k v -> Bool
- notMember :: Ord k => k -> OMap k v -> Bool
- lookup :: Ord k => k -> OMap k v -> Maybe v
- type Index = Int
- findIndex :: Ord k => k -> OMap k v -> Maybe Index
- elemAt :: OMap k v -> Index -> Maybe (k, v)
- fromList :: Ord k => [(k, v)] -> OMap k v
- assocs :: OMap k v -> [(k, v)]
- toAscList :: OMap k v -> [(k, v)]
Documentation
Instances
Foldable (OMap k) Source # | Values are produced in insertion order, not key order. |
Defined in Data.Map.Ordered fold :: Monoid m => OMap k m -> m # foldMap :: Monoid m => (a -> m) -> OMap k a -> m # foldr :: (a -> b -> b) -> b -> OMap k a -> b # foldr' :: (a -> b -> b) -> b -> OMap k a -> b # foldl :: (b -> a -> b) -> b -> OMap k a -> b # foldl' :: (b -> a -> b) -> b -> OMap k a -> b # foldr1 :: (a -> a -> a) -> OMap k a -> a # foldl1 :: (a -> a -> a) -> OMap k a -> a # elem :: Eq a => a -> OMap k a -> Bool # maximum :: Ord a => OMap k a -> a # minimum :: Ord a => OMap k a -> a # | |
(Eq k, Eq v) => Eq (OMap k v) Source # | |
(Ord k, Ord v) => Ord (OMap k v) Source # | |
Defined in Data.Map.Ordered | |
(Ord k, Read k, Read v) => Read (OMap k v) Source # | |
(Show k, Show v) => Show (OMap k v) Source # | |
Trivial maps
Insertion
Conventions:
- The open side of an angle bracket points to an
OMap
- The pipe appears on the side whose indices take precedence if both sides contain the same key
- The left argument's indices are lower than the right argument's indices
- If both sides contain the same key, the tuple's value wins
Deletion
filter :: Ord k => (k -> v -> Bool) -> OMap k v -> OMap k v Source #
filter f m
contains exactly the key-value pairs of m
that satisfy f
,
without changing the order they appear
(\\) :: Ord k => OMap k v -> OMap k v' -> OMap k v Source #
m \\ n
deletes all the keys that exist in n
from m
Query
Indexing
A 0-based index, much like the indices used by lists' !!
operation. All
indices are with respect to insertion order.