distributed-dataset-0.0.1.0: A distributed data processing framework in pure Haskell
Safe HaskellNone
LanguageHaskell2010

Control.Distributed.Dataset.Aggr

Synopsis

Documentation

data Aggr a b Source #

Represent an aggregation which takes many as and returns a single b.

Instances

Instances details
StaticProfunctor Aggr Source # 
Instance details

Defined in Control.Distributed.Dataset.Internal.Aggr

Methods

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 # 
Instance details

Defined in Control.Distributed.Dataset.Internal.Aggr

Methods

staticApply :: (Typeable a, Typeable b) => Aggr m (a -> b) -> Aggr m a -> Aggr m b Source #

Typeable m => StaticFunctor (Aggr m) Source # 
Instance details

Defined in Control.Distributed.Dataset.Internal.Aggr

Methods

staticMap :: (Typeable a, Typeable b) => Closure (a -> b) -> Aggr m a -> Aggr m b 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.

aggrCount :: Typeable a => Aggr a Integer Source #

Returns the number of inputs.

aggrSum :: StaticSerialise a => Closure (Dict (Num a)) -> Aggr a a Source #

Returns the sum of the inputs.

aggrMean :: Aggr Double Double Source #

Calculates the mean 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.

aggrTopK Source #

Arguments

:: (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)

aggrBottomK Source #

Arguments

:: (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.

aggrFromFold Source #

Arguments

:: (StaticSerialise t, Typeable a, Typeable b) 
=> Closure (Fold a t)

Fold to run before the shuffle

-> Closure (Fold t b)

Fold to run after the shuffle

-> Aggr a b 

Create an aggregation given two Folds.