Hoogle Search
Within LTS Haskell 24.21 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
foldl' :: (a -> Key -> a) -> a -> Word64Set -> aghc-lib-parser GHC.Data.Word64Set.Internal A strict version of foldl. Each application of the operator is evaluated before using the result in the next application. This function is strict in the starting value.
foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> bghc-lib-parser GHC.Prelude.Basic Left-associative fold of a structure but with strict application of the operator. This ensures that each step of the fold is forced to Weak Head Normal Form before being applied, avoiding the collection of thunks that would otherwise occur. This is often what you want to strictly reduce a finite structure to a single strict result (e.g. sum). For a general Foldable structure this should be semantically identical to,
foldl' f z = foldl' f z . toList
foldl' :: (Contiguous arr, Element arr a) => (b -> a -> b) -> b -> arr a -> bcontiguous Data.Primitive.Contiguous Strict left fold over the elements of an array.
foldl' :: Foldable collection => (a -> Element collection -> a) -> a -> collection -> afoundation Foundation Left-associative fold of a structure. In the case of lists, foldl, when applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn
Note that to produce the outermost application of the operator the entire input list must be traversed. This means that foldl' will diverge if given an infinite list. Note that Foundation only provides foldl', a strict version of foldl because the lazy version is seldom useful. Left-associative fold of a structure with strict application of the operator.foldl' :: Foldable collection => (a -> Element collection -> a) -> a -> collection -> afoundation Foundation.Collection Left-associative fold of a structure. In the case of lists, foldl, when applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn
Note that to produce the outermost application of the operator the entire input list must be traversed. This means that foldl' will diverge if given an infinite list. Note that Foundation only provides foldl', a strict version of foldl because the lazy version is seldom useful. Left-associative fold of a structure with strict application of the operator.foldl' :: (a -> b -> a) -> a -> MonoidalIntMap b -> amonoidal-containers Data.IntMap.Monoidal No documentation available.
foldl' :: (a -> b -> a) -> a -> MonoidalIntMap b -> amonoidal-containers Data.IntMap.Monoidal.Strict No documentation available.
foldl' :: forall k a b . (a -> b -> a) -> a -> MonoidalMap k b -> amonoidal-containers Data.Map.Monoidal No documentation available.
foldl' :: forall k a b . (a -> b -> a) -> a -> MonoidalMap k b -> amonoidal-containers Data.Map.Monoidal.Strict No documentation available.
foldl' :: (a -> b -> a) -> a -> NEIntMap b -> anonempty-containers Data.IntMap.NonEmpty O(n). A strict version of foldl. Each application of the operator is evaluated before using the result in the next application. This function is strict in the starting value.