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

Fold.Nonempty.Utilities

Synopsis

Documentation

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

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

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

Applies a function to each input before processing

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

Nest a fold in an applicative

repeatedly Source #

Arguments

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

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

-> NonemptyFold x result 
-> NonemptyFold xs result 

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