on e0a1851 help sign in
rel8/src/Rel8/Column.hs
32 lines 813 B history raw
1{-# language DataKinds #-}
2{-# language StandaloneKindSignatures #-}
3{-# language TypeFamilies #-}
5module Rel8.Column
6 ( Column
7 , TColumn
8 )
9where
11-- base
12import Data.Kind ( Type )
13import Prelude ()
15-- rel8
16import Rel8.FCF ( Eval, Exp )
17import qualified Rel8.Schema.Kind as K
18import Rel8.Schema.Context.Lower ( Lower )
19import Rel8.Schema.Result ( Result )
22-- | This type family is used to specify columns in 'Rel8able's. In @Column f
23-- a@, @f@ is the context of the column (which should be left polymorphic in
24-- 'Rel8able' definitions), and @a@ is the type of the column.
25type Column :: K.Context -> Type -> Type
26type family Column context a where
27 Column Result a = a
28 Column context a = Lower context a
31data TColumn :: K.Context -> Type -> Exp Type
32type instance Eval (TColumn f a) = Column f a