@@ -47,6 +47,7 @@ import Rel8.Table
4747 )
4848
4949
50+-- | The kind of 'Rel8able' types
5051type KRel8able :: Type
5152type KRel8able = K.Rel8able
5253
@@ -62,34 +63,34 @@ type KRel8able = K.Rel8able
6263-- , fieldN :: Column f Tn OR HKn f
6364-- }
6465-- @
65−--
66+--
6667-- where @Tn@ is any Haskell type, and @HKn@ is any higher-kinded type.
67−--
68+--
6869-- That is, higher-kinded data are records where all fields in the record are
6970-- all either of the type @Column f T@ (for any @T@), or are themselves
7071-- higher-kinded data:
71−--
72+--
7273-- [Nested]
73−--
74+--
7475-- @
7576-- data Nested f =
7677-- Nested { nested1 :: MyType f
7778-- , nested2 :: MyType f
7879-- }
7980-- @
80−--
81+--
8182-- The @Rel8able@ type class is used to give us a special mapping operation
8283-- that lets us change the type parameter @f@.
83−--
84+--
8485-- [Supplying @Rel8able@ instances]
85−--
86+--
8687-- This type class should be derived generically for all table types in your
8788-- project. To do this, enable the @DeriveAnyType@ and @DeriveGeneric@ language
8889-- extensions:
89−--
90+--
9091-- @
9192-- \{\-\# LANGUAGE DeriveAnyClass, DeriveGeneric #-\}
92−--
93+--
9394-- data MyType f = MyType { fieldA :: Column f T }
9495-- deriving ( GHC.Generics.Generic, Rel8able )
9596-- @