Document HList, HNonEmpty, HMaybe, HThese and HEither

This commit is contained in:
Ollie Charles 2021-06-18 11:16:33 +01:00
parent da86165828
commit 4b50256af0
5 changed files with 14 additions and 0 deletions

View File

@ -35,6 +35,9 @@ import Rel8.Table.Either ( EitherTable )
import Rel8.Table.Recontextualize ( Recontextualize )
-- | Nest an 'Either' value within a 'Rel8able'. @HEither f a b@ will produce a
-- 'EitherTable' @a b@ in the 'Expr' context, and a 'Either' @a b@ in the
-- 'Result' context.
type HEither :: K.Context -> Type -> Type -> Type
type family HEither context where
HEither (Reify context) = AHEither context

View File

@ -35,6 +35,8 @@ import Rel8.Table.Recontextualize ( Recontextualize )
import Rel8.Table.Unreify ( Unreifiability(..), Unreifiable, unreifiability )
-- | Nest a list within a 'Rel8able'. @HList f a@ will produce a 'ListTable'
-- @a@ in the 'Expr' context, and a @[a]@ in the 'Result' context.
type HList :: K.Context -> Type -> Type
type family HList context where
HList (Reify context) = AHList context

View File

@ -34,6 +34,9 @@ import Rel8.Table.Maybe ( MaybeTable )
import Rel8.Table.Recontextualize ( Recontextualize )
-- | Nest a 'Maybe' value within a 'Rel8able'. @HMaybe f a@ will produce a
-- 'MaybeTable' @a@ in the 'Expr' context, and a 'Maybe' @a@ in the 'Result'
-- context.
type HMaybe :: K.Context -> Type -> Type
type family HMaybe context where
HMaybe (Reify context) = AHMaybe context

View File

@ -36,6 +36,9 @@ import Rel8.Table.Recontextualize ( Recontextualize )
import Rel8.Table.Unreify ( Unreifiability(..), Unreifiable, unreifiability )
-- | Nest a 'NonEmpty' list within a 'Rel8able'. @HNonEmpty f a@ will produce a
-- 'NonEmptyTable' @a@ in the 'Expr' context, and a 'NonEmpty' @a@ in the
-- 'Result' context.
type HNonEmpty :: K.Context -> Type -> Type
type family HNonEmpty context where
HNonEmpty (Reify context) = AHNonEmpty context

View File

@ -39,6 +39,9 @@ import Rel8.Table.These ( TheseTable )
import Data.These ( These )
-- | Nest an 'These' value within a 'Rel8able'. @HThese f a b@ will produce a
-- 'TheseTable' @a b@ in the 'Expr' context, and a 'These' @a b@ in the
-- 'Result' context.
type HThese :: K.Context -> Type -> Type -> Type
type family HThese context where
HThese (Reify context) = AHThese context