1{-# language DataKinds #-}
2{-# language StandaloneKindSignatures #-}
3{-# language TypeFamilies #-}
4{-# language UndecidableInstances #-}
6module Rel8.Schema.Field
12import Data.Functor.Identity ( Identity )
13import Data.Kind ( Type )
17import Rel8.Aggregate ( Aggregate )
18import Rel8.Expr ( Expr )
19import Rel8.Kind.Labels ( Labels )
20import Rel8.Kind.Necessity ( Necessity( Required, Optional ) )
21import Rel8.Schema.Context ( Insertion, IsSpecialContext )
22import qualified Rel8.Schema.Kind as K
23import Rel8.Schema.Spec ( Spec( Spec ) )
24import Rel8.Schema.Structure ( Structure, Shape( Column ), Shape1 )
27type IField :: Bool -> K.Context -> Labels -> Necessity -> Type -> Type -> Type
28type family IField isSpecialContext labels context necessity db a where
29 IField 'False context _labels _necessity _db a = context a
30 IField 'True Identity _labels _necessity _db a = a
31 IField 'True Expr _labels _necessity _db a = Expr a
32 IField 'True Insertion _labels 'Required _db a = Expr a
33 IField 'True Insertion _labels 'Optional _db a = Maybe (Expr a)
34 IField 'True Aggregate _labels _necessity _db a = Aggregate (Expr a)
35 IField 'True Structure labels necessity db a = Shape1 'Column ('Spec labels necessity db a)
38type Field :: K.Context -> Labels -> Necessity -> Type -> Type -> Type
39type Field context labels necessity db a =
40 IField (IsSpecialContext context) context labels necessity db 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