on 379b492 help sign in
rel8/src/Rel8/Column/NonEmpty.hs
27 lines 748 B history raw
1{-# language DataKinds #-}
2{-# language StandaloneKindSignatures #-}
3{-# language TypeFamilyDependencies #-}
5module Rel8.Column.NonEmpty
6 ( HNonEmpty
7 )
8where
10-- base
11import Data.Kind ( Type )
12import Data.List.NonEmpty ( NonEmpty )
13import Prelude ()
15-- rel8
16import qualified Rel8.Schema.Kind as K
17import Rel8.Schema.Result ( Result )
18import Rel8.Table.NonEmpty ( NonEmptyTable )
21-- | Nest a 'NonEmpty' list within a 'Rel8able'. @HNonEmpty f a@ will produce a
22-- 'NonEmptyTable' @a@ in the 'Expr' context, and a 'NonEmpty' @a@ in the
23-- 'Result' context.
24type HNonEmpty :: K.Context -> Type -> Type
25type family HNonEmpty context = nonEmpty | nonEmpty -> context where
26 HNonEmpty Result = NonEmpty
27 HNonEmpty context = NonEmptyTable context