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

Fold.Effectful.Nonempty

Description

Folds from Fold.Pure.Nonempty trivially lifted into EffectfulFold

Synopsis

General

magma :: (a -> a -> a) -> Monad m => EffectfulFold m a (Maybe a) Source #

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

semigroup :: Semigroup a => Monad m => EffectfulFold m a (Maybe a) Source #

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

Endpoints

first :: Monad m => EffectfulFold m a (Maybe a) Source #

The first input

last :: Monad m => EffectfulFold m a (Maybe a) Source #

The last input

Extrema

maximum :: Ord a => Monad m => EffectfulFold m a (Maybe a) Source #

The greatest input

minimum :: Ord a => Monad m => EffectfulFold m a (Maybe a) Source #

The least input

maximumBy :: (a -> a -> Ordering) -> Monad m => EffectfulFold m a (Maybe a) Source #

The greatest input with respect to the given comparison function

minimumBy :: (a -> a -> Ordering) -> Monad m => EffectfulFold m a (Maybe a) Source #

The least input with respect to the given comparison function