1{-# language DataKinds #-}
3{-# language StandaloneKindSignatures #-}
4{-# language TypeFamilies #-}
5{-# language UndecidableInstances #-}
7module Rel8.Schema.HTable.Type
13import Data.Kind ( Type )
14import Data.Proxy ( Proxy( Proxy ) )
18import Rel8.Kind.Bool ( KnownBool, boolSing, IsList )
19import Rel8.Kind.Labels ( SLabels( SLabel ) )
20import Rel8.Kind.Necessity ( Necessity( Required ), SNecessity( SRequired ) )
21import Rel8.Schema.Dict ( Dict( Dict ) )
22import Rel8.Schema.HTable
23 ( HTable, HConstrainTable, HField
24 , hfield, htabulate, htraverse, hdicts, hspecs
26import Rel8.Schema.HTable.Context ( H, HKTable )
27import Rel8.Schema.Nullability ( Unnullify, Nullabilizes, nullabilization )
28import Rel8.Schema.Spec ( Context, Spec( Spec ), SSpec(..) )
29import Rel8.Type ( DBType, typeInformation )
32type HType :: Type -> HKTable
33data HType a context where
35 { unHType :: context ('Spec '[""] 'Required (Unnullify a) a)
36 } -> HType a (H context)
39type HTypeField :: Type -> Context
40data HTypeField a spec where
41 HTypeField :: HTypeField a ('Spec '[""] 'Required (Unnullify a) a)
44instance (DBType db, Nullabilizes db a, KnownBool (IsList db)) =>
47 type HConstrainTable (HType a) c = c ('Spec '[""] 'Required (Unnullify a) a)
48 type HField (HType a) = HTypeField a
50 hfield (HType a) HTypeField = a
51 htabulate f = HType $ f HTypeField
52 htraverse f (HType a) = HType <$> f a
55 { labels = SLabel Proxy
56 , necessity = SRequired
57 , info = typeInformation
58 , nullability = nullabilization
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