1{-# language DataKinds #-}
2{-# language FlexibleContexts #-}
3{-# language FlexibleInstances #-}
4{-# language OverloadedStrings #-}
5{-# language StandaloneKindSignatures #-}
6{-# language TypeFamilies #-}
7{-# language UndecidableInstances #-}
10 ( DBMonoid( memptyExpr )
15import Data.Kind ( Constraint, Type )
16import Prelude hiding ( null )
19import Data.ByteString ( ByteString )
20import qualified Data.ByteString.Lazy as Lazy ( ByteString )
23import Data.CaseInsensitive ( CI )
26import {-# SOURCE #-} Rel8.Expr ( Expr )
27import Rel8.Expr.Array ( sempty )
28import Rel8.Expr.Serialize ( litExpr )
29import Rel8.Schema.Nullability ( Sql, nullabilization )
30import Rel8.Type ( DBType, typeInformation )
31import Rel8.Type.Semigroup ( DBSemigroup )
34import Data.Text ( Text )
35import qualified Data.Text.Lazy as Lazy ( Text )
38import Data.Time.Clock ( DiffTime, NominalDiffTime )
41-- | The class of 'DBType's that form a semigroup. This class is purely a Rel8
42-- concept, and exists to mirror the 'Monoid' class.
43type DBMonoid :: Type -> Constraint
44class DBSemigroup a => DBMonoid a where
45 -- The identity for '<>.'
49instance Sql DBType a => DBMonoid [a] where
50 memptyExpr = sempty nullabilization typeInformation
53instance DBMonoid DiffTime where
54 memptyExpr = litExpr 0
57instance DBMonoid NominalDiffTime where
58 memptyExpr = litExpr 0
61instance DBMonoid Text where
62 memptyExpr = litExpr ""
65instance DBMonoid Lazy.Text where
66 memptyExpr = litExpr ""
69instance DBMonoid (CI Text) where
70 memptyExpr = litExpr ""
73instance DBMonoid (CI Lazy.Text) where
74 memptyExpr = litExpr ""
77instance DBMonoid ByteString where
78 memptyExpr = litExpr ""
81instance DBMonoid Lazy.ByteString where
82 memptyExpr = litExpr ""
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