rel8-internal
Safe HaskellNone
LanguageHaskell2010

Rel8.Internal.Table.Aggregate.Maybe

Synopsis

Documentation

filterWhereOptional :: forall a i (fold :: Fold) (fold' :: Fold). Table Expr a => (i -> Expr Bool) -> Aggregator' fold i a -> Aggregator' fold' i (MaybeTable Expr a) Source #

A variant of filterWhere that can be used with an Aggregator1 (upgrading it to an Aggregator in the process). It returns nothingTable in the case where the predicate matches zero rows.

optionalAggregate :: forall a (fold :: Fold) i (fold' :: Fold). Table Expr a => Aggregator' fold i a -> Aggregator' fold' i (MaybeTable Expr a) Source #

optionalAggregate upgrades an Aggregator1 into an Aggregator by having it return nothingTable when aggregating over an empty collection of rows.

aggregateJustTable :: forall a i (fold :: Fold). Table Expr a => Aggregator i a -> Aggregator' fold (MaybeTable Expr i) a Source #

Lift an Aggregator to operate on a MaybeTable. If the input query has justTable is, they are folded into a single a by the given aggregator — in the case where the input query is all nothingTables, the Aggregator's fallback a is returned.

aggregateJustTable1 :: forall a (fold :: Fold) i (fold' :: Fold). Table Expr a => Aggregator' fold i a -> Aggregator' fold' (MaybeTable Expr i) (MaybeTable Expr a) Source #

Lift an Aggregator1 to operate on a MaybeTable. If the input query has justTable is, they are folded into a single justTable a by the given aggregator — in the case where the input query is all nothingTables, a single nothingTable row is returned.

aggregateMaybeTable :: forall (fold :: Fold) i a. Aggregator' fold i a -> Aggregator1 (MaybeTable Expr i) (MaybeTable Expr a) Source #

Lift an aggregator to operate on a MaybeTable. nothingTables and justTables are grouped separately.