Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Aggr a b
- aggrConst :: forall a t. (Typeable a, Typeable t) => Closure a -> Aggr t a
- aggrCount :: Typeable a => Aggr a Integer
- aggrSum :: StaticSerialise a => Closure (Dict (Num a)) -> Aggr a a
- aggrMean :: Aggr Double Double
- aggrMax :: StaticSerialise a => Closure (Dict (Ord a)) -> Aggr a (Maybe a)
- aggrMin :: StaticSerialise a => Closure (Dict (Ord a)) -> Aggr a (Maybe a)
- aggrCollect :: StaticSerialise a => Aggr a [a]
- aggrDistinct :: forall a. (StaticSerialise a, StaticHashable a) => Aggr a (HashSet a)
- aggrTopK :: (StaticSerialise a, Typeable k) => Closure (Dict (Ord k)) -> Int -> Closure (a -> k) -> Aggr a [a]
- aggrBottomK :: (StaticSerialise a, Typeable k) => Closure (Dict (Ord k)) -> Int -> Closure (a -> k) -> Aggr a [a]
- aggrFiltered :: Closure (a -> Bool) -> Aggr a b -> Aggr a b
- aggrFromMonoid :: StaticSerialise a => Closure (Dict (Monoid a)) -> Aggr a a
- aggrFromReduce :: StaticSerialise a => Closure (a -> a -> a) -> Aggr a (Maybe a)
- aggrFromFold :: (StaticSerialise t, Typeable a, Typeable b) => Closure (Fold a t) -> Closure (Fold t b) -> Aggr a b
Documentation
Represent an aggregation which takes many a
s and returns a single b
.
Instances
StaticProfunctor Aggr Source # | |
Defined in Control.Distributed.Dataset.Internal.Aggr staticDimap :: (Typeable a, Typeable b, Typeable c, Typeable d) => Closure (a -> b) -> Closure (c -> d) -> Aggr b c -> Aggr a d Source # staticLmap :: (Typeable a, Typeable b, Typeable c) => Closure (a -> b) -> Aggr b c -> Aggr a c Source # staticRmap :: (Typeable a, Typeable c, Typeable d) => Closure (c -> d) -> Aggr a c -> Aggr a d Source # | |
Typeable m => StaticApply (Aggr m) Source # | |
Defined in Control.Distributed.Dataset.Internal.Aggr | |
Typeable m => StaticFunctor (Aggr m) Source # | |
aggrConst :: forall a t. (Typeable a, Typeable t) => Closure a -> Aggr t a Source #
An aggregation which ignores the input data and always yields the given value.
aggrSum :: StaticSerialise a => Closure (Dict (Num a)) -> Aggr a a Source #
Returns the sum of the inputs.
aggrMax :: StaticSerialise a => Closure (Dict (Ord a)) -> Aggr a (Maybe a) Source #
Return the maximum of the inputs.
aggrMin :: StaticSerialise a => Closure (Dict (Ord a)) -> Aggr a (Maybe a) Source #
Return the minimum of the inputs.
aggrCollect :: StaticSerialise a => Aggr a [a] Source #
Collects the inputs as a list.
aggrDistinct :: forall a. (StaticSerialise a, StaticHashable a) => Aggr a (HashSet a) Source #
Collects the inputs to a HashSet
.
:: (StaticSerialise a, Typeable k) | |
=> Closure (Dict (Ord k)) | |
-> Int | Number of rows to return |
-> Closure (a -> k) | Sorting key |
-> Aggr a [a] |
Returns the n
greatest elements according to a key function. Similar to:
take n . sortOn (Down . f)
:: (StaticSerialise a, Typeable k) | |
=> Closure (Dict (Ord k)) | |
-> Int | Number of rows to return |
-> Closure (a -> k) | Sorting key |
-> Aggr a [a] |
Returns the n
least elements according to a key function. Similar to:
take n . sortOn (Down . f)
aggrFiltered :: Closure (a -> Bool) -> Aggr a b -> Aggr a b Source #
Returns a new Aggr which only aggregates rows matching the predicate, discarding others.
Creating Aggr's
aggrFromMonoid :: StaticSerialise a => Closure (Dict (Monoid a)) -> Aggr a a Source #
Create an aggregation given a Monoid
instance.
aggrFromReduce :: StaticSerialise a => Closure (a -> a -> a) -> Aggr a (Maybe a) Source #
Create an aggregation given a reduce function.