1{-# language DataKinds #-}
2{-# language StandaloneKindSignatures #-}
3{-# language TypeFamilies #-}
4{-# language UndecidableInstances #-}
6module Rel8.Schema.Field
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.Context
21 ( Aggregation, DB, Insertion, Result
24import Rel8.Schema.Spec ( Context, Spec( Spec ) )
25import Rel8.Schema.Structure ( Structure, Shape( Column ), Shape1 )
28type IField :: Bool -> Context -> Labels -> Necessity -> Type -> Type -> Type
29type family IField isSpecialContext labels context necessity db a where
30 IField 'False context labels necessity db a = context ('Spec labels necessity db a)
31 IField 'True Result _labels _necessity _db a = a
32 IField 'True DB _labels _necessity _db a = Expr a
33 IField 'True Insertion _labels 'Required _db a = Expr a
34 IField 'True Insertion _labels 'Optional _db a = Maybe (Expr a)
35 IField 'True Aggregation _labels _necessity _db a = Aggregate (Expr a)
36 IField 'True Structure labels necessity db a = Shape1 'Column ('Spec labels necessity db a)
39type Field :: Context -> Labels -> Necessity -> Type -> Type -> Type
40type Field context labels necessity db a =
41 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