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.
mapWithKey :: (k -> v1 -> v2) -> WeightedPSQ w k v1 -> WeightedPSQ w k v2cabal-install-solver Distribution.Solver.Modular.WeightedPSQ O(N). Update the values.
mapDeps :: (Component -> a -> b) -> ComponentDeps a -> ComponentDeps bcabal-install-solver Distribution.Solver.Types.ComponentDeps Keep only selected components (and their associated deps info).
mapMB :: (Int -> Int) -> Approx -> Approxcdar-mBound Data.CDAR.Approx No documentation available.
mapSubvectors :: (Vector u a, Vector v b) => (u a -> v b) -> Chimera u a -> Chimera v bchimera Data.Chimera Map subvectors of a stream, using a given length-preserving function.
mapAccumL :: forall acc x y (n :: Nat) . (acc -> x -> (acc, y)) -> acc -> Vec n x -> (acc, Vec n y)clash-prelude Clash.Explicit.Prelude The mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a vector, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new vector.
>>> mapAccumL (\acc x -> (acc + x,acc + 1)) 0 (1 :> 2 :> 3 :> 4 :> Nil) (10,1 :> 2 :> 4 :> 7 :> Nil)
"mapAccumL f acc xs" corresponds to the following circuit layout:mapAccumR :: forall acc x y (n :: Nat) . (acc -> x -> (acc, y)) -> acc -> Vec n x -> (acc, Vec n y)clash-prelude Clash.Explicit.Prelude The mapAccumR function behaves like a combination of map and foldr; it applies a function to each element of a vector, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new vector.
>>> mapAccumR (\acc x -> (acc + x,acc + 1)) 0 (1 :> 2 :> 3 :> 4 :> Nil) (10,10 :> 8 :> 5 :> 1 :> Nil)
"mapAccumR f acc xs" corresponds to the following circuit layout:mapAccumL :: forall acc x y (n :: Nat) . (acc -> x -> (acc, y)) -> acc -> Vec n x -> (acc, Vec n y)clash-prelude Clash.Explicit.Prelude.Safe The mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a vector, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new vector.
>>> mapAccumL (\acc x -> (acc + x,acc + 1)) 0 (1 :> 2 :> 3 :> 4 :> Nil) (10,1 :> 2 :> 4 :> 7 :> Nil)
"mapAccumL f acc xs" corresponds to the following circuit layout:mapAccumR :: forall acc x y (n :: Nat) . (acc -> x -> (acc, y)) -> acc -> Vec n x -> (acc, Vec n y)clash-prelude Clash.Explicit.Prelude.Safe The mapAccumR function behaves like a combination of map and foldr; it applies a function to each element of a vector, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new vector.
>>> mapAccumR (\acc x -> (acc + x,acc + 1)) 0 (1 :> 2 :> 3 :> 4 :> Nil) (10,10 :> 8 :> 5 :> 1 :> Nil)
"mapAccumR f acc xs" corresponds to the following circuit layout:mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)clash-prelude Clash.HaskellPrelude Map each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see mapM_.
Examples
mapM is literally a traverse with a type signature restricted to Monad. Its implementation may be more efficient due to additional power of Monad.mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()clash-prelude Clash.HaskellPrelude Map each element of a structure to a monadic action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see mapM. mapM_ is just like traverse_, but specialised to monadic actions.