@@ -24,5 +24,12 @@ some :: Table DB a => Query a -> Query (NonEmptyTable a)
24some = aggregate . fmap nonEmptyAgg
24some = aggregate . fmap nonEmptyAgg
27+-- | Aggregate a 'Query' into a 'ListTable'. If the supplied query returns 0
28+-- rows, this function will produce a 'Query' that returns one row containing
29+-- the empty @ListTable@. If the supplied @Query@ does return rows, @many@ will
30+-- return exactly one row, with a @ListTable@ collecting all returned rows.
32+-- @many@ is analogous to 'Control.Applicative.many' from
33+-- @Control.Applicative@.
27many :: Table DB a => Query a -> Query (ListTable a)
34many :: Table DB a => Query a -> Query (ListTable a)
28many = fmap (maybeTable mempty id) . optional . aggregate . fmap listAgg
35many = fmap (maybeTable mempty id) . optional . aggregate . fmap listAgg