on master help sign in
Document Query
eb57de9Ollie Charles
src/Rel8/Query.hs+4
@@ -23,14 +23,18 @@ import Rel8.Table.Alternative
23 )
23 )
24
24
25
25
26+-- | The @Query@ monad allows you to compose a @SELECT@ query. This monad has
27+-- semantics similar to the list (@[]@) monad.
26type Query :: Type -> Type
28type Query :: Type -> Type
27newtype Query a = Query (Opaleye.Select a)
29newtype Query a = Query (Opaleye.Select a)
28 deriving newtype (Functor, Applicative, Monad)
30 deriving newtype (Functor, Applicative, Monad)
29
31
30
32
33+-- | '<|>:' = 'unionAll'.
31instance AltTable Query where
34instance AltTable Query where
32 (<|>:) = unionAll
35 (<|>:) = unionAll
33
36
34
37
38+-- | 'emptyTable' = 'values' @[]@.
35instance AlternativeTable Query where
39instance AlternativeTable Query where
36 emptyTable = values []
40 emptyTable = values []