Hoogle Search
Within LTS Haskell 24.6 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
foldlOf :: Getting (Dual (Endo r)) s a -> (r -> a -> r) -> r -> s -> rlens Control.Lens.Fold Left-associative fold of the parts of a structure that are viewed through a Lens, Getter, Fold or Traversal.
foldl ≡ foldlOf folded
foldlOf :: Getter s a -> (r -> a -> r) -> r -> s -> r foldlOf :: Fold s a -> (r -> a -> r) -> r -> s -> r foldlOf :: Lens' s a -> (r -> a -> r) -> r -> s -> r foldlOf :: Iso' s a -> (r -> a -> r) -> r -> s -> r foldlOf :: Traversal' s a -> (r -> a -> r) -> r -> s -> r foldlOf :: Prism' s a -> (r -> a -> r) -> r -> s -> r
foldlOf' :: Getting (Endo (Endo r)) s a -> (r -> a -> r) -> r -> s -> rlens Control.Lens.Fold Fold over the elements of a structure, associating to the left, but strictly.
foldl' ≡ foldlOf' folded
foldlOf' :: Getter s a -> (r -> a -> r) -> r -> s -> r foldlOf' :: Fold s a -> (r -> a -> r) -> r -> s -> r foldlOf' :: Iso' s a -> (r -> a -> r) -> r -> s -> r foldlOf' :: Lens' s a -> (r -> a -> r) -> r -> s -> r foldlOf' :: Traversal' s a -> (r -> a -> r) -> r -> s -> r
foldlC :: forall (m :: Type -> Type) a b o . Monad m => (a -> b -> a) -> a -> ConduitT b o m aconduit Conduit A strict left fold.
-
conduit Conduit A strict left fold on a chunked stream.
foldl1 :: forall (m :: Type -> Type) a o . Monad m => (a -> a -> a) -> ConduitT a o m (Maybe a)conduit Data.Conduit.Combinators A strict left fold with no starting value. Returns Nothing when the stream is empty. Subject to fusion
-
conduit Data.Conduit.Combinators A strict left fold on a chunked stream. Subject to fusion
foldl1S :: forall (m :: Type -> Type) a . Monad m => (a -> a -> a) -> StreamConsumer a m (Maybe a)conduit Data.Conduit.Combinators.Stream No documentation available.
foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> bhedgehog Hedgehog.Internal.Prelude 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
foldl1 :: Foldable t => (a -> a -> a) -> t a -> ahedgehog Hedgehog.Internal.Prelude A variant of foldl that has no base case, and thus may only be applied to non-empty structures. This function is non-total and will raise a runtime exception if the structure happens to be empty.
foldl1 f = foldl1 f . toList
Examples
Basic usage:>>> foldl1 (+) [1..4] 10
>>> foldl1 (+) [] *** Exception: Prelude.foldl1: empty list
>>> foldl1 (+) Nothing *** Exception: foldl1: empty structure
>>> foldl1 (-) [1..4] -8
>>> foldl1 (&&) [True, False, True, True] False
>>> foldl1 (||) [False, False, True, True] True
>>> foldl1 (+) [1..] * Hangs forever *
foldl1Def :: a -> (a -> a -> a) -> [a] -> asafe Safe Deprecated: Use foldl1May instead.