Hoogle Search
Within LTS Haskell 24.36 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
unordered-containers Data.HashMap.Internal A bitmap as contained by a BitmapIndexed node, or a fullBitmap corresponding to a Full node. Only the lower maxChildren bits are used. The remaining bits must be zeros.
BitmapIndexed :: Bitmap -> !Array (HashMap k v) -> HashMap k vunordered-containers Data.HashMap.Internal Invariants:
- Only the lower maxChildren bits of the Bitmap may be set. The remaining upper bits must be 0. (INV2)
- The array of a BitmapIndexed node stores at least 1 and at most maxChildren - 1 sub-nodes. (INV3)
- The number of sub-nodes is equal to the number of 1-bits in its Bitmap. (INV4)
- If a BitmapIndexed node has only one sub-node, this sub-node must be a BitmapIndexed or a Full node. (INV5)
-
unordered-containers Data.HashMap.Internal A map from keys to values. A map cannot contain duplicate keys; each key can map to at most one value.
bitmapIndexedOrFull :: Bitmap -> Array (HashMap k v) -> HashMap k vunordered-containers Data.HashMap.Internal Create a BitmapIndexed or Full node.
-
unordered-containers Data.HashMap.Internal Common implementation for filterWithKey and mapMaybeWithKey, allowing the former to former to reuse terms.
foldMapWithKey :: Monoid m => (k -> v -> m) -> HashMap k v -> munordered-containers Data.HashMap.Internal Reduce the map by applying a function to each element and combining the results with a monoid operation.
-
unordered-containers Data.HashMap.Internal A bitmap with the maxChildren least significant bits set, i.e. 0xFF_FF_FF_FF.
isSubmapOf :: (Hashable k, Eq v) => HashMap k v -> HashMap k v -> Boolunordered-containers Data.HashMap.Internal Inclusion of maps. A map is included in another map if the keys are subsets and the corresponding values are equal:
isSubmapOf m1 m2 = keys m1 `isSubsetOf` keys m2 && and [ v1 == v2 | (k1,v1) <- toList m1; let v2 = m2 ! k1 ]
Examples
>>> fromList [(1,'a')] `isSubmapOf` fromList [(1,'a'),(2,'b')] True
>>> fromList [(1,'a'),(2,'b')] `isSubmapOf` fromList [(1,'a')] False
isSubmapOfBy :: Hashable k => (v1 -> v2 -> Bool) -> HashMap k v1 -> HashMap k v2 -> Boolunordered-containers Data.HashMap.Internal Inclusion of maps with value comparison. A map is included in another map if the keys are subsets and if the comparison function is true for the corresponding values:
isSubmapOfBy cmpV m1 m2 = keys m1 `isSubsetOf` keys m2 && and [ v1 `cmpV` v2 | (k1,v1) <- toList m1; let v2 = m2 ! k1 ]
Examples
>>> isSubmapOfBy (<=) (fromList [(1,'a')]) (fromList [(1,'b'),(2,'c')]) True
>>> isSubmapOfBy (<=) (fromList [(1,'b')]) (fromList [(1,'a'),(2,'c')]) False
foldMap :: Monoid m => (a -> m) -> Array a -> munordered-containers Data.HashMap.Internal.Array No documentation available.