on 97d89cf help sign in
rel8/src/Rel8/Column/Either.hs
31 lines 857 B history raw
1{-# language DataKinds #-}
2{-# language StandaloneKindSignatures #-}
3{-# language TypeFamilyDependencies #-}
5module Rel8.Column.Either
6 ( HEither
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.Either ( EitherTable )
23-- | Nest an 'Either' value within a 'Rel8able'. @HEither f a b@ will produce a
24-- 'EitherTable' @a b@ in the 'Expr' context, and a 'Either' @a b@ in the
25-- 'Result' context.
26type HEither :: K.Context -> Type -> Type -> Type
27type family HEither context = either | either -> context where
28 HEither Aggregate = EitherTable Aggregate
29 HEither Expr = EitherTable Expr
30 HEither Name = EitherTable Name
31 HEither Result = Either