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

Fold.Nonempty.Examples

Synopsis

General

magma :: (a -> a -> a) -> NonemptyFold a a Source #

Start with the first input, append each new input on the right with the given function

semigroup :: Semigroup a => NonemptyFold a a Source #

Append each new input on the right with (<>)

Endpoints

first :: NonemptyFold a a Source #

The first input

last :: NonemptyFold a a Source #

The last input

Extrema

maximum :: Ord a => NonemptyFold a a Source #

The greatest input

minimum :: Ord a => NonemptyFold a a Source #

The least input

maximumBy :: (a -> a -> Ordering) -> NonemptyFold a a Source #

The greatest input with respect to the given comparison function

minimumBy :: (a -> a -> Ordering) -> NonemptyFold a a Source #

The least input with respect to the given comparison function

List

list :: NonemptyFold a (NonEmpty a) Source #

All the inputs

reverseList :: NonemptyFold a (NonEmpty a) Source #

All the inputs in reverse order