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.Labels ( SLabels( SLabel ) )
19import Rel8.Kind.Necessity ( Necessity( Required ), SNecessity( SRequired ) )
20import Rel8.Schema.Dict ( Dict( Dict ) )
21import Rel8.Schema.HTable
22 ( HTable, HConstrainTable, HField
23 , hfield, htabulate, htraverse, hdicts, hspecs
25import Rel8.Schema.HTable.Context ( H, HKTable )
26import Rel8.Schema.Nullability ( Unnullify, Nullabilizes, nullabilization )
27import Rel8.Schema.Spec ( Context, Spec( Spec ), SSpec(..) )
28import Rel8.Type ( DBType, typeInformation )
31type HType :: Type -> HKTable
32data HType a context where
34 { unHType :: context ('Spec '[""] 'Required (Unnullify a) a)
35 } -> HType a (H context)
38type HTypeField :: Type -> Context
39data HTypeField a spec where
40 HTypeField :: HTypeField a ('Spec '[""] 'Required (Unnullify a) a)
43instance (DBType db, Nullabilizes db a) => HTable (HType a) where
44 type HConstrainTable (HType a) c = c ('Spec '[""] 'Required (Unnullify a) a)
45 type HField (HType a) = HTypeField a
47 hfield (HType a) HTypeField = a
48 htabulate f = HType $ f HTypeField
49 htraverse f (HType a) = HType <$> f a
52 { labels = SLabel Proxy
53 , necessity = SRequired
54 , info = typeInformation
55 , 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