1{-# language DataKinds #-}
2{-# language StandaloneKindSignatures #-}
3{-# language TypeFamilies #-}
5module Rel8.Schema.Field
11import Data.Functor.Identity ( Identity )
12import Data.Kind ( Type )
16import Rel8.Aggregate ( Aggregate )
17import Rel8.Expr ( Expr )
18import Rel8.Kind.Labels ( Labels )
19import Rel8.Kind.Necessity ( Necessity( Required, Optional ) )
20import Rel8.Schema.Insert ( Insert )
21import qualified Rel8.Schema.Kind as K
22import Rel8.Schema.Spec ( Spec( Spec ) )
23import Rel8.Schema.Structure ( Structure, Shape( Column ), Shape1 )
26type Field :: K.Context -> Labels -> Necessity -> Type -> Type
27type family Field labels context necessity a where
28 Field Identity _labels _necessity a = a
29 Field Expr _labels _necessity a = Expr a
30 Field Insert _labels 'Required a = Expr a
31 Field Insert _labels 'Optional a = Maybe (Expr a)
32 Field Aggregate _labels _necessity a = Aggregate (Expr a)
33 Field Structure labels necessity a = Shape1 'Column ('Spec labels necessity a)
34 Field context _labels _necessity a = context a
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