Hoogle Search

Within LTS Haskell 24.5 (ghc-9.10.2)

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

  1. mapAccumL :: (acc -> Word8 -> (acc, Word8)) -> acc -> ByteString -> (acc, ByteString)

    rio RIO.ByteString.Lazy

    The mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a ByteString, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new ByteString.

  2. mapAccumR :: (acc -> Word8 -> (acc, Word8)) -> acc -> ByteString -> (acc, ByteString)

    rio RIO.ByteString.Lazy

    The mapAccumR function behaves like a combination of map and foldr; it applies a function to each element of a ByteString, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new ByteString.

  3. mapMaybe :: (v1 -> Maybe v2) -> HashMap k v1 -> HashMap k v2

    rio RIO.HashMap

    Transform this map by applying a function to every value and retaining only some of them.

  4. mapMaybeWithKey :: (k -> v1 -> Maybe v2) -> HashMap k v1 -> HashMap k v2

    rio RIO.HashMap

    Transform this map by applying a function to every value and retaining only some of them.

  5. mapWithKey :: (k -> v1 -> v2) -> HashMap k v1 -> HashMap k v2

    rio RIO.HashMap

    Transform this map by applying a function to every value.

  6. mapAccumL :: Traversable t => (s -> a -> (s, b)) -> s -> t a -> (s, t b)

    rio RIO.List

    The mapAccumL function behaves like a combination of fmap and foldl; it applies a function to each element of a structure, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new structure.

    Examples

    Basic usage:
    >>> mapAccumL (\a b -> (a + b, a)) 0 [1..10]
    (55,[0,1,3,6,10,15,21,28,36,45])
    
    >>> mapAccumL (\a b -> (a <> show b, a)) "0" [1..5]
    ("012345",["0","01","012","0123","01234"])
    

  7. mapAccumR :: Traversable t => (s -> a -> (s, b)) -> s -> t a -> (s, t b)

    rio RIO.List

    The mapAccumR function behaves like a combination of fmap and foldr; it applies a function to each element of a structure, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new structure.

    Examples

    Basic usage:
    >>> mapAccumR (\a b -> (a + b, a)) 0 [1..10]
    (55,[54,52,49,45,40,34,27,19,10,0])
    
    >>> mapAccumR (\a b -> (a <> show b, a)) "0" [1..5]
    ("054321",["05432","0543","054","05","0"])
    

  8. mapAccum :: (a -> b -> (a, c)) -> a -> Map k b -> (a, Map k c)

    rio RIO.Map

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

  9. mapAccumRWithKey :: (a -> k -> b -> (a, c)) -> a -> Map k b -> (a, Map k c)

    rio RIO.Map

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

  10. mapAccumWithKey :: (a -> k -> b -> (a, c)) -> a -> Map k b -> (a, Map k c)

    rio RIO.Map

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

Page 124 of many | Previous | Next