Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.HashCons.IntMap
Description
Synopsis
- data IntMap a
- empty :: IntMap a
- singleton :: Hashable a => Int -> a -> IntMap a
- singletonNonEmpty :: Hashable a => Int -> a -> NonEmptyIntMap a
- insert :: Hashable a => Int -> a -> IntMap a -> IntMap a
- insertNonEmpty :: Hashable a => Int -> a -> NonEmptyIntMap a -> NonEmptyIntMap a
- lookup :: Int -> IntMap a -> Maybe a
- lookupNonEmpty :: Int -> NonEmptyIntMap a -> Maybe a
- map :: Hashable b => (a -> b) -> IntMap a -> IntMap b
- mapWithKey :: Hashable b => (Int -> a -> b) -> IntMap a -> IntMap b
- traverseWithKey :: (Applicative t, Hashable b) => (Int -> a -> t b) -> IntMap a -> t (IntMap b)
- union :: Hashable a => IntMap a -> IntMap a -> IntMap a
- unionNonEmpty :: Hashable a => NonEmptyIntMap a -> IntMap a -> NonEmptyIntMap a
- intersection :: Hashable a => IntMap a -> IntMap a -> IntMap a
- intersectionNonEmpty :: Hashable a => NonEmptyIntMap a -> IntMap a -> IntMap a
- difference :: Hashable a => IntMap a -> IntMap a -> IntMap a
- differenceNonEmpty :: Hashable a => NonEmptyIntMap a -> IntMap a -> IntMap a
- member :: Int -> IntMap a -> Bool
Documentation
singleton :: Hashable a => Int -> a -> IntMap a Source #
O(1). Create a map with a single key-value pair.
singletonNonEmpty :: Hashable a => Int -> a -> NonEmptyIntMap a Source #
O(1). Create a map with a single key-value pair.
insert :: Hashable a => Int -> a -> IntMap a -> IntMap a Source #
O(log n). Insert a key-value pair into the map.
insertNonEmpty :: Hashable a => Int -> a -> NonEmptyIntMap a -> NonEmptyIntMap a Source #
O(log n). Insert a key-value pair into the map.
lookupNonEmpty :: Int -> NonEmptyIntMap a -> Maybe a Source #
O(log n). Lookup the value at a key in the map.
map :: Hashable b => (a -> b) -> IntMap a -> IntMap b Source #
O(n). Map a function over all values in the map.
mapWithKey :: Hashable b => (Int -> a -> b) -> IntMap a -> IntMap b Source #
O(n). Map a function over all key-value pairs in the map.
traverseWithKey :: (Applicative t, Hashable b) => (Int -> a -> t b) -> IntMap a -> t (IntMap b) Source #
O(n). Traverse the map with a function that accesses keys.
union :: Hashable a => IntMap a -> IntMap a -> IntMap a Source #
O(n). The union of two maps. If a key occurs in both maps, the value from the left map is used.
unionNonEmpty :: Hashable a => NonEmptyIntMap a -> IntMap a -> NonEmptyIntMap a Source #
O(n). The union of two maps. If a key occurs in both maps, the value from the left map is used.
intersection :: Hashable a => IntMap a -> IntMap a -> IntMap a Source #
O(n). Intersection of two maps. Only keys present in both maps are included.
intersectionNonEmpty :: Hashable a => NonEmptyIntMap a -> IntMap a -> IntMap a Source #
O(n). Intersection of two maps. Only keys present in both maps are included.
difference :: Hashable a => IntMap a -> IntMap a -> IntMap a Source #
O(n). Difference of two maps. Keys in the first map but not in the second are included.