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

Fold.Pure.Examples.Interesting

Synopsis

Monoid

monoid :: Monoid a => Fold a a Source #

Start with mempty, append each input on the right with (<>)

Length

length :: Fold a Natural Source #

The number of inputs

Numeric

sum :: Num a => Fold a a Source #

Adds the inputs

product :: Num a => Fold a a Source #

Multiplies the inputs

mean :: Fractional a => Fold a a Source #

Numerically stable arithmetic mean of the inputs

variance :: Fractional a => Fold a a Source #

Numerically stable (population) variance over the inputs

standardDeviation :: Floating a => Fold a a Source #

Numerically stable (population) standard deviation over the inputs

List

list :: Fold a [a] Source #

All the inputs

reverseList :: Fold a [a] Source #

All the inputs in reverse order