on da76712 help sign in
rel8/src/Rel8/Column/Maybe.hs
26 lines 659 B history raw
1{-# language DataKinds #-}
2{-# language StandaloneKindSignatures #-}
3{-# language TypeFamilyDependencies #-}
5module Rel8.Column.Maybe
6 ( HMaybe
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.Maybe ( MaybeTable )
20-- | Nest a 'Maybe' value within a 'Rel8able'. @HMaybe f a@ will produce a
21-- 'MaybeTable' @a@ in the 'Expr' context, and a 'Maybe' @a@ in the 'Result'
22-- context.
23type HMaybe :: K.Context -> Type -> Type
24type family HMaybe context = maybe | maybe -> context where
25 HMaybe Result = Maybe
26 HMaybe context = MaybeTable context