@@ -20,6 +20,14 @@ import Rel8.Table.Maybe ( maybeTable )
20import Rel8.Table.NonEmpty ( NonEmptyTable )
20import Rel8.Table.NonEmpty ( NonEmptyTable )
23+-- | Aggregate a 'Query' into a 'NonEmptyTable'. If the supplied query returns
24+-- 0 rows, this function will produce a 'Query' that is empty - that is, will
25+-- produce zero @NonEmptyTable@s. If the supplied @Query@ does return rows,
26+-- @some@ will return exactly one row, with a @NonEmptyTable@ collecting all
29+-- @some@ is analogous to 'Control.Applicative.some' from
30+-- @Control.Applicative@.
23some :: Table DB a => Query a -> Query (NonEmptyTable a)
31some :: Table DB a => Query a -> Query (NonEmptyTable a)
24some = aggregate . fmap nonEmptyAgg
32some = aggregate . fmap nonEmptyAgg