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

Fold.ShortcutNonempty.Utilities

Synopsis

Documentation

demotivate :: ShortcutNonemptyFold a b -> ShortcutNonemptyFold a b Source #

Causes a shortcut fold to stop once it becomes ambivalent

duplicate :: ShortcutNonemptyFold a b -> ShortcutNonemptyFold a (ShortcutFold a b) Source #

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

repeatedly Source #

Arguments

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

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

-> ShortcutNonemptyFold x result 
-> ShortcutNonemptyFold xs result 

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

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

Applies a function to each input before processing