gambler-0.4.1.0: Composable, streaming, and efficient left folds
Safe HaskellSafe-Inferred
LanguageGHC2021

Fold.Pure.Utilities

Synopsis

Documentation

duplicate :: Fold a b -> Fold a (Fold a b) Source #

Allows to continue feeding a fold even after passing it to a function that closes it

premap :: (a -> b) -> Fold b r -> Fold a r Source #

Applies a function to each input before processing

prefilter :: (a -> Bool) -> Fold a r -> Fold a r Source #

Consider only inputs that match a predicate

predropWhile :: (a -> Bool) -> Fold a r -> Fold a r Source #

Ignores inputs until they stop satisfying a predicate

drop :: Natural -> Fold a b -> Fold a b Source #

Ignores the first n inputs

nest :: Applicative f => Fold a b -> Fold (f a) (f b) Source #

Nest a fold in an applicative

repeatedly Source #

Arguments

:: forall x xs result. (forall b. Fold x b -> xs -> b)

A witness to the fact that xs is a list of x

-> Fold x result 
-> Fold xs result 

Convert a fold for a single item (x) into a fold for lists of items (xs)