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.

  1. package monoidmap

    Monoidal map type Monoidal map type with support for semigroup and monoid subclasses.

  2. module Data.MonoidMap

    No documentation available.

  3. data MonoidMap k v

    monoidmap Data.MonoidMap

    No documentation available.

  4. foldMapWithKey :: Monoid r => (k -> v -> r) -> MonoidMap k v -> r

    monoidmap 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)
    

  5. foldMapWithKey' :: Monoid r => (k -> v -> r) -> MonoidMap k v -> r

    monoidmap Data.MonoidMap

    A strict version of foldMapWithKey. Each application of mappend is evaluated before using the result in the next application.

  6. fromMap :: MonoidNull v => Map k v -> MonoidMap k v

    monoidmap 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.

  7. fromMapWith :: MonoidNull v2 => (v1 -> v2) -> Map k v1 -> MonoidMap k v2

    monoidmap 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.

  8. isSubmapOf :: (Ord k, Monoid v, Reductive v) => MonoidMap k v -> MonoidMap k v -> Bool

    monoidmap 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))
    

  9. isSubmapOfBy :: (Ord k, Monoid v1, Monoid v2) => (v1 -> v2 -> Bool) -> MonoidMap k v1 -> MonoidMap k v2 -> Bool

    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))
    

  10. toMap :: MonoidMap k v -> Map k v

    monoidmap 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
    

Page 990 of many | Previous | Next