on da76712 help sign in
rel8/src/Rel8/Column/Null.hs
26 lines 647 B history raw
1{-# language DataKinds #-}
2{-# language StandaloneKindSignatures #-}
3{-# language TypeFamilyDependencies #-}
5module Rel8.Column.Null
6 ( HNull
7 )
8where
10-- base
11import Data.Kind ( Type )
12import Prelude
14-- rel8
15import qualified Rel8.Schema.Kind as K
16import Rel8.Schema.Result ( Result )
17import Rel8.Table.Null ( NullTable )
20-- | Nest a 'Null' value within a 'Rel8able'. @HNull f a@ will produce a
21-- 'NullTable' @a@ in the 'Expr' context, and a @'Maybe' a@ in the 'Result'
22-- context.
23type HNull :: K.Context -> Type -> Type
24type family HNull context = maybe | maybe -> context where
25 HNull Result = Maybe
26 HNull context = NullTable context