@@ -23,6 +23,11 @@ import Rel8.Table.Eq ( EqTable )
23import Rel8.Table.Opaleye ( distinctspec, unpackspec )
23import Rel8.Table.Opaleye ( distinctspec, unpackspec )
26+-- | Select all distinct rows from a query, removing duplicates. @distinct q@
27+-- is equivalent to the SQL statement @SELECT DISTINCT q@.
29+-- >>> select c $ distinct $ values [ lit True, lit True, lit False ]
26distinct :: EqTable a => Query a -> Query a
31distinct :: EqTable a => Query a -> Query a
27distinct = mapOpaleye (Opaleye.distinctExplicit distinctspec)
32distinct = mapOpaleye (Opaleye.distinctExplicit distinctspec)