on master help sign in
Document distinct
commitd469c7720b7506a2033981e13f2a6d3ad8fa53a2 authorOllie Charles <ollie@ocharles.org.uk> dateTue 23 Mar 2021, 16:21 (6 years ago) parenta7e9e9e
1 file changed+5
src/Rel8/Query/Distinct.hs+5
src/Rel8/Query/Distinct.hs+5
@@ -23,6 +23,11 @@ import Rel8.Table.Eq ( EqTable )
2323import Rel8.Table.Opaleye ( distinctspec, unpackspec )
2424
2525
26+-- | Select all distinct rows from a query, removing duplicates. @distinct q@
27+-- is equivalent to the SQL statement @SELECT DISTINCT q@.
28+--
29+-- >>> select c $ distinct $ values [ lit True, lit True, lit False ]
30+-- [False,True]
2631distinct :: EqTable a => Query a -> Query a
2732distinct = mapOpaleye (Opaleye.distinctExplicit distinctspec)
2833