Hoogle Search

Within LTS Haskell 24.34 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. mapKeys :: forall k1 k2 a . Ord k2 => (k1 -> k2) -> MonoidalMap k1 a -> MonoidalMap k2 a

    monoidal-containers Data.Map.Monoidal.Strict

    No documentation available.

  2. mapKeysMonotonic :: (k1 -> k2) -> MonoidalMap k1 a -> MonoidalMap k2 a

    monoidal-containers Data.Map.Monoidal.Strict

    O(n). mapKeysMonotonic f s == mapKeys f s, but works only when f is strictly increasing (both monotonic and injective). That is, for any values x and y, if x < y then f x < f y and f is injective (i.e. it never maps two input keys to the same output key). The precondition is not checked. Semi-formally, we have:

    and [x < y ==> f x < f y | x <- ls, y <- ls]
    ==> mapKeysMonotonic f s == mapKeys f s
    where ls = keys s
    
    This means that f maps distinct original keys to distinct resulting keys. This function has better performance than mapKeys.
    mapKeysMonotonic (\ k -> k * 2) (fromList [(5,"a"), (3,"b")]) == fromList [(6, "b"), (10, "a")]
    valid (mapKeysMonotonic (\ k -> k * 2) (fromList [(5,"a"), (3,"b")])) == True
    valid (mapKeysMonotonic (\ _ -> 1)     (fromList [(5,"a"), (3,"b")])) == False
    

  3. mapKeysWith :: forall k1 k2 a . Ord k2 => (a -> a -> a) -> (k1 -> k2) -> MonoidalMap k1 a -> MonoidalMap k2 a

    monoidal-containers Data.Map.Monoidal.Strict

    No documentation available.

  4. mapMaybe :: forall k a b . (a -> Maybe b) -> MonoidalMap k a -> MonoidalMap k b

    monoidal-containers Data.Map.Monoidal.Strict

    No documentation available.

  5. mapMaybeWithKey :: (k -> a -> Maybe b) -> MonoidalMap k a -> MonoidalMap k b

    monoidal-containers Data.Map.Monoidal.Strict

    No documentation available.

  6. mapWithKey :: (k -> a -> b) -> MonoidalMap k a -> MonoidalMap k b

    monoidal-containers Data.Map.Monoidal.Strict

    No documentation available.

  7. mapKeys :: Ord k2 => (k1 -> k2) -> MultiMap k1 a -> MultiMap k2 a

    multimap Data.MultiMap

    mapKeys f s is the multimap obtained by applying f to each key of s.

  8. mapWithKey :: (k -> a -> b) -> MultiMap k a -> MultiMap k b

    multimap Data.MultiMap

    Map a function over all key/value pairs in the map.

  9. mapAccum :: (a -> b -> (a, c)) -> a -> NEIntMap b -> (a, NEIntMap c)

    nonempty-containers Data.IntMap.NonEmpty

    O(n). The function mapAccum threads an accumulating argument through the map in ascending order of keys.

    let f a b = (a ++ b, b ++ "X")
    mapAccum f "Everything: " (fromList ((5,"a") :| [(3,"b")])) == ("Everything: ba", fromList ((3, "bX") :| [(5, "aX")]))
    

  10. mapAccumRWithKey :: (a -> Key -> b -> (a, c)) -> a -> NEIntMap b -> (a, NEIntMap c)

    nonempty-containers Data.IntMap.NonEmpty

    O(n). The function mapAccumRWithKey threads an accumulating argument through the map in descending order of keys.

Page 241 of many | Previous | Next