on 97d89cf help sign in
rel8/src/Rel8/Column/List.hs
30 lines 787 B history raw
1{-# language DataKinds #-}
2{-# language StandaloneKindSignatures #-}
3{-# language TypeFamilyDependencies #-}
5module Rel8.Column.List
6 ( HList
7 )
8where
10-- base
11import Data.Kind ( Type )
12import Prelude ()
14-- rel8
15import Rel8.Aggregate ( Aggregate )
16import Rel8.Expr ( Expr )
17import qualified Rel8.Schema.Kind as K
18import Rel8.Schema.Name ( Name )
19import Rel8.Schema.Result ( Result )
20import Rel8.Table.List ( ListTable )
23-- | Nest a list within a 'Rel8able'. @HList f a@ will produce a 'ListTable'
24-- @a@ in the 'Expr' context, and a @[a]@ in the 'Result' context.
25type HList :: K.Context -> Type -> Type
26type family HList context = list | list -> context where
27 HList Aggregate = ListTable Aggregate
28 HList Expr = ListTable Expr
29 HList Name = ListTable Name
30 HList Result = []