1{-# language DerivingStrategies #-}
2{-# language DerivingVia #-}
3{-# language GeneralizedNewtypeDeriving #-}
4{-# language StandaloneKindSignatures #-}
12import Data.Kind ( Type )
16import qualified Opaleye.Select as Opaleye
19import Rel8.Query.Set ( unionAll )
20import Rel8.Query.Values ( values )
21import Rel8.Table.Alternative
23 , AlternativeTable, emptyTable
27import Data.Functor.Apply ( Apply, WrappedApplicative(..) )
28import Data.Functor.Bind ( Bind, (>>-) )
31-- | The @Query@ monad allows you to compose a @SELECT@ query. This monad has
32-- semantics similar to the list (@[]@) monad.
33type Query :: Type -> Type
34newtype Query a = Query (Opaleye.Select a)
35 deriving newtype (Functor, Applicative, Monad)
36 deriving Apply via (WrappedApplicative Opaleye.Select)
39instance Bind Query where
43-- | '<|>:' = 'unionAll'.
44instance AltTable Query where
48-- | 'emptyTable' = 'values' @[]@.
49instance AlternativeTable Query where
50 emptyTable = values []
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list