folds-common-0.1.0.0: A playground of common folds for folds

Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Fold.Common.L'

Synopsis

Documentation

sum :: Num a => L' a a Source

Sum of the inputs

product :: Num a => L' a a Source

Product of the input

count :: Enum e => L' a e Source

Count the number of elements fed to a fold

msum :: Monoid m => L' m m Source

mappend all the elements of a sequence together.

minimum :: Ord a => L' a (Maybe a) Source

Minimum of all inputs. If no inputs are supplied this returns Nothing.

maximum :: Ord a => L' a (Maybe a) Source

Maximum of all inputs. If no inputs are supplied this returns Nothing.

nub :: Ord a => L' a [a] Source

De-duplicate all the inputs while preserving order. O(n log(n))

slowNub :: Eq a => L' a [a] Source

De-duplicate all the inputs while preserving order. O(n^2)

intoSet :: Ord a => L' a (Set a) Source

Collect all members into a Set.

last :: L' a (Maybe a) Source

Grab the last element inputted

nth :: (Eq b, Num b) => b -> L' a (Maybe a) Source

Grab the nth element inputted