@@ -136,6 +136,48 @@ instance (IsSpecialContext context ~ 'False, Labelable context, Nullifiable cont
136 gtoColumns = toUnspecialColumns
136 gtoColumns = toUnspecialColumns
139+-- | This type class allows you to define custom 'Table's using higher-kinded
140+-- data types. Higher-kinded data types are data types of the pattern:
144+-- MyType { field1 :: Column f T1 OR HK1 f
145+-- , field2 :: Column f T2 OR HK2 f
147+-- , fieldN :: Column f Tn OR HKn f
151+-- where @Tn@ is any Haskell type, and @HKn@ is any higher-kinded type.
153+-- That is, higher-kinded data are records where all fields in the record are
154+-- all either of the type @Column f T@ (for any @T@), or are themselves
155+-- higher-kinded data:
161+-- Nested { nested1 :: MyType f
162+-- , nested2 :: MyType f
166+-- The @Rel8able@ type class is used to give us a special mapping operation
167+-- that lets us change the type parameter @f@.
169+-- [Supplying @Rel8able@ instances]
171+-- This type class should be derived generically for all table types in your
172+-- project. To do this, enable the @DeriveAnyType@ and @DeriveGeneric@ language
176+-- \{\-\# LANGUAGE DeriveAnyClass, DeriveGeneric #-\}
178+-- data MyType f = MyType { fieldA :: Column f T }
179+-- deriving ( GHC.Generics.Generic, Rel8able )
139type Rel8able :: KTable -> Constraint
181type Rel8able :: KTable -> Constraint
140class HTable (GRep t) => Rel8able t where
182class HTable (GRep t) => Rel8able t where
141 type GRep t :: K.HTable
183 type GRep t :: K.HTable