on e0a1851 help sign in
rel8/src/Rel8/Column/These.hs
34 lines 878 B history raw
1{-# language DataKinds #-}
2{-# language StandaloneKindSignatures #-}
3{-# language TypeFamilyDependencies #-}
5module Rel8.Column.These
6 ( HThese
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.These ( TheseTable )
22-- these
23import Data.These ( These )
26-- | Nest an 'These' value within a 'Rel8able'. @HThese f a b@ will produce a
27-- 'TheseTable' @a b@ in the 'Expr' context, and a 'These' @a b@ in the
28-- 'Result' context.
29type HThese :: K.Context -> Type -> Type -> Type
30type family HThese context = these | these -> context where
31 HThese Aggregate = TheseTable Aggregate
32 HThese Expr = TheseTable Expr
33 HThese Name = TheseTable Name
34 HThese Result = These