Hoogle Search

Within LTS Haskell 24.33 (ghc-9.10.3)

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

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

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

    monoidal-containers Data.Map.Monoidal.Strict

    No documentation available.

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

    monoidal-containers Data.Map.Monoidal.Strict

    No documentation available.

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

    monoidal-containers Data.Map.Monoidal.Strict

    No documentation available.

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

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

    multimap Data.MultiMap

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

  7. 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")]))
    

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

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

    nonempty-containers Data.IntMap.NonEmpty

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

    let f a k b = (a ++ " " ++ (show k) ++ "-" ++ b, b ++ "X")
    mapAccumWithKey f "Everything:" (fromList ((5,"a") :| [(3,"b")])) == ("Everything: 3-b 5-a", fromList ((3, "bX") :| [(5, "aX")]))
    

  10. mapEither :: (a -> Either b c) -> NEIntMap a -> These (NEIntMap b) (NEIntMap c)

    nonempty-containers Data.IntMap.NonEmpty

    O(n). Map values and separate the Left and Right results. Returns a These with potentially two non-empty maps:

    • This n1 means that the results were all Left.
    • That n2 means that the results were all Right.
    • These n1 n2 gives n1 (the map where the results were Left) and n2 (the map where the results were Right)
    let f a = if a < "c" then Left a else Right a
    mapEither f (fromList ((5,"a") :| [(3,"b"), (1,"x"), (7,"z")]))
    == These (fromList ((3,"b") :| [(5,"a")])) (fromList ((1,"x") :| [(7,"z")]))
    
    mapEither (\ a -> Right a) (fromList ((5,"a") :| [(3,"b"), (1,"x"), (7,"z")]))
    == That (fromList ((5,"a") :| [(3,"b"), (1,"x"), (7,"z")]))
    

Page 238 of many | Previous | Next