Hoogle Search
Within LTS Haskell 24.40 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
Monoidal map type Monoidal map type with support for semigroup and monoid subclasses.
-
No documentation available.
-
monoidmap Data.MonoidMap No documentation available.
foldMapWithKey :: Monoid r => (k -> v -> r) -> MonoidMap k v -> rmonoidmap Data.MonoidMap Folds over the keys and values in the map using the given monoid. Satisfies the following property:
foldMapWithKey f m == Map.foldMapWithKey f (toMap m)
foldMapWithKey' :: Monoid r => (k -> v -> r) -> MonoidMap k v -> rmonoidmap Data.MonoidMap A strict version of foldMapWithKey. Each application of mappend is evaluated before using the result in the next application.
fromMap :: MonoidNull v => Map k v -> MonoidMap k vmonoidmap Data.MonoidMap Constructs a MonoidMap from an ordinary Map. Satisfies the following property for all possible keys k:
get k (fromMap m) == Map.findWithDefault mempty k m
This function performs canonicalisation of null values, and has a time complexity that is linear in the size of the map.fromMapWith :: MonoidNull v2 => (v1 -> v2) -> Map k v1 -> MonoidMap k v2monoidmap Data.MonoidMap Constructs a MonoidMap from an ordinary Map, applying the given function to all values. Satisfies the following property for all possible keys k:
get k (fromMapWith f m) == maybe mempty f (Map.lookup k m)
This function performs canonicalisation of null values, and has a time complexity that is linear in the size of the map.isSubmapOf :: (Ord k, Monoid v, Reductive v) => MonoidMap k v -> MonoidMap k v -> Boolmonoidmap Data.MonoidMap Indicates whether or not the first map is a submap of the second. Map m1 is a submap of map m2 if (and only if) m1 can be subtracted from m2 with the minusMaybe operation:
m1 `isSubmapOf` m2 == isJust (m2 `minusMaybe` m1)
Equivalently, map m1 is a submap of map m2 if (and only if) for all possible keys k, the value for k in m1 can be subtracted from the value for k in m2 with the (</>) operator:m1 `isSubmapOf` m2 == (∀ k. isJust (get k m2 </> get k m1))
-
monoidmap Data.MonoidMap Indicates whether or not the first map is a submap of the second, using the given function to compare values for matching keys. Satisfies the following property:
isSubmapOfBy f m1 m2 == all (\k -> f (get k m1) (get k m2)) (nonNullKeys m1)
Conditional totality
If the given comparison function f always evaluates to True when its first argument is mempty:∀ v. f mempty v
Then the following property holds:isSubmapOfBy f m1 m2 == (∀ k. f (get k m1) (get k m2))
toMap :: MonoidMap k v -> Map k vmonoidmap Data.MonoidMap Converts a MonoidMap to an ordinary Map. The result only includes entries with values that are not null. Satisfies the following round-trip property:
fromMap (toMap m) == m