1{-# language DataKinds #-}
2{-# language FlexibleContexts #-}
3{-# language MultiParamTypeClasses #-}
4{-# language StandaloneKindSignatures #-}
5{-# language TypeFamilies #-}
7module Rel8.Schema.Field
14import Data.Functor.Identity ( Identity( Identity ) )
15import Data.Kind ( Type )
19import Rel8.Schema.HTable ( HField, htabulate )
20import Rel8.Schema.HTable.Identity ( HIdentity( HIdentity ) )
21import Rel8.Schema.Kind as K
22import Rel8.Schema.Null ( Sql )
24 ( Table, Columns, Context, fromColumns, toColumns
25 , FromExprs, fromResult, toResult
28import Rel8.Table.Transpose ( Transposes )
29import Rel8.Type ( DBType )
32-- | A special context used in the construction of 'Rel8.Projection's.
33type Field :: Type -> K.Context
34newtype Field table a = Field (HField (Columns table) a)
37instance Sql DBType a => Table (Field table) (Field table a) where
38 type Columns (Field table a) = HIdentity a
39 type Context (Field table a) = Field table
40 type FromExprs (Field table a) = a
41 type Transpose to (Field table a) = to a
44 fromColumns (HIdentity a) = a
45 toResult a = HIdentity (Identity a)
46 fromResult (HIdentity (Identity a)) = a
49fields :: Transposes context (Field table) table fields => fields
50fields = fromColumns $ htabulate Field
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