Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Folds of other types trivially lifted into Shortcut
Synopsis
- sum :: Num a => ShortcutFold a a
- product :: Num a => ShortcutFold a a
- mean :: Fractional a => ShortcutFold a a
- variance :: Fractional a => ShortcutFold a a
- standardDeviation :: Floating a => ShortcutFold a a
- length :: ShortcutFold a Natural
- maximum :: Ord a => ShortcutFold a (Maybe a)
- minimum :: Ord a => ShortcutFold a (Maybe a)
- maximumBy :: (a -> a -> Ordering) -> ShortcutFold a (Maybe a)
- minimumBy :: (a -> a -> Ordering) -> ShortcutFold a (Maybe a)
- first :: ShortcutFold a (Maybe a)
- last :: ShortcutFold a (Maybe a)
- magma :: (a -> a -> a) -> ShortcutFold a (Maybe a)
- semigroup :: Semigroup a => ShortcutFold a (Maybe a)
- monoid :: Monoid a => ShortcutFold a a
- list :: ShortcutFold a [a]
- reverseList :: ShortcutFold a [a]
Arithmetic folds
sum :: Num a => ShortcutFold a a Source #
Adds the inputs (ambivalent)
product :: Num a => ShortcutFold a a Source #
Multiplies the inputs (ambivalent)
mean :: Fractional a => ShortcutFold a a Source #
Numerically stable arithmetic mean of the inputs (ambivalent)
variance :: Fractional a => ShortcutFold a a Source #
Numerically stable (population) variance over the inputs (ambivalent)
standardDeviation :: Floating a => ShortcutFold a a Source #
Numerically stable (population) standard deviation over the inputs (ambivalent)
Counting inputs
length :: ShortcutFold a Natural Source #
The number of inputs (ambivalent)
Min/max
maximumBy :: (a -> a -> Ordering) -> ShortcutFold a (Maybe a) Source #
The greatest input with respect to the given comparison function (ambivalent)
minimumBy :: (a -> a -> Ordering) -> ShortcutFold a (Maybe a) Source #
The least input with respect to the given comparison function (ambivalent)
First/last
first :: ShortcutFold a (Maybe a) Source #
The first input (tenacious)
last :: ShortcutFold a (Maybe a) Source #
The last input (ambivalent)
General folds
magma :: (a -> a -> a) -> ShortcutFold a (Maybe a) Source #
Start with the first input, append each new input on the right with the given function (ambivalent)
semigroup :: Semigroup a => ShortcutFold a (Maybe a) Source #
Append each new input on the right with <>
(ambivalent)
monoid :: Monoid a => ShortcutFold a a Source #
Start with mempty
, append each input on the right with <>
(ambivalent)
List folds
list :: ShortcutFold a [a] Source #
All the inputs (ambivalent)
reverseList :: ShortcutFold a [a] Source #
All the inputs in reverse order (ambivalent)