on master help sign in
Document some
c6a154cOllie Charles
src/Rel8/Query/List.hs+8
@@ -20,6 +20,14 @@ import Rel8.Table.Maybe ( maybeTable )
20import Rel8.Table.NonEmpty ( NonEmptyTable )
20import Rel8.Table.NonEmpty ( NonEmptyTable )
21
21
22
22
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
27+-- returned rows.
28+--
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
25
33