on 05564f4 help sign in
rel8/src/Rel8/Query.hs
36 lines 681 B history raw
1{-# language DerivingStrategies #-}
2{-# language GeneralizedNewtypeDeriving #-}
3{-# language StandaloneKindSignatures #-}
5module Rel8.Query
6 ( Query( Query )
7 )
8where
10-- base
11import Data.Kind ( Type )
12import Prelude
14-- opaleye
15import qualified Opaleye.Select as Opaleye
17-- rel8
18import Rel8.Query.Set ( unionAll )
19import Rel8.Query.Values ( values )
20import Rel8.Table.Alternative
21 ( AltTable, (<|>:)
22 , AlternativeTable, emptyTable
23 )
26type Query :: Type -> Type
27newtype Query a = Query (Opaleye.Select a)
28 deriving newtype (Functor, Applicative, Monad)
31instance AltTable Query where
32 (<|>:) = unionAll
35instance AlternativeTable Query where
36 emptyTable = values []