Safe Haskell | Safe |
---|---|
Language | Haskell98 |
- newtype Aggregator a b = Aggregator (PackMap (Maybe AggrOp, PrimExpr) PrimExpr a b)
- makeAggr' :: Maybe AggrOp -> Aggregator (Column a) (Column b)
- makeAggr :: AggrOp -> Aggregator (Column a) (Column b)
- runAggregator :: Applicative f => Aggregator a b -> ((Maybe AggrOp, PrimExpr) -> f PrimExpr) -> a -> f b
- aggregateU :: Aggregator a b -> (a, PrimQuery, Tag) -> (b, PrimQuery, Tag)
- extractAggregateFields :: Tag -> (Maybe AggrOp, PrimExpr) -> PM [(Symbol, (Maybe AggrOp, PrimExpr))] PrimExpr
Documentation
newtype Aggregator a b Source
An Aggregator
takes a collection of rows of type a
, groups
them, and transforms each group into a single row of type b
. This
corresponds to aggregators using GROUP BY
in SQL.
An Aggregator
corresponds closely to a Fold
from the
foldl
package. Whereas an Aggregator
a
b
takes each group of
type a
to a single row of type b
, a Fold
a
b
takes a list of a
and returns a single row of type b
.
runAggregator :: Applicative f => Aggregator a b -> ((Maybe AggrOp, PrimExpr) -> f PrimExpr) -> a -> f b Source
aggregateU :: Aggregator a b -> (a, PrimQuery, Tag) -> (b, PrimQuery, Tag) Source