on master help sign in
Add and export KRel8able
242dc79Oliver Charles
src/Rel8.hs+1−1
@@ -26,7 +26,7 @@ module Rel8
26 , DBFractional
26 , DBFractional
27
27
28 -- * Tables and higher-kinded tables
28 -- * Tables and higher-kinded tables
29− , Rel8able
29+ , Rel8able, KRel8able
30 , Column, Field, Necessity( Required, Optional )
30 , Column, Field, Necessity( Required, Optional )
31 , Default
31 , Default
32 , HMaybe
32 , HMaybe
src/Rel8/Schema/Generic.hs+6−1
@@ -18,6 +18,7 @@
18
18
19module Rel8.Schema.Generic
19module Rel8.Schema.Generic
20 ( Rel8able
20 ( Rel8able
21+ , KRel8able
21 )
22 )
22where
23where
23
24
@@ -61,6 +62,10 @@ instance
61 toColumns = hunreify . gtoColumns . reify
62 toColumns = hunreify . gtoColumns . reify
62
63
63
64
65+type KRel8able :: Type
66+type KRel8able = K.Table
67+
68+
64-- | This type class allows you to define custom 'Table's using higher-kinded
69-- | This type class allows you to define custom 'Table's using higher-kinded
65-- data types. Higher-kinded data types are data types of the pattern:
70-- data types. Higher-kinded data types are data types of the pattern:
66--
71--
@@ -103,7 +108,7 @@ instance
103-- data MyType f = MyType { fieldA :: Column f T }
108-- data MyType f = MyType { fieldA :: Column f T }
104-- deriving ( GHC.Generics.Generic, Rel8able )
109-- deriving ( GHC.Generics.Generic, Rel8able )
105-- @
110-- @
106−type Rel8able :: K.Table -> Constraint
111+type Rel8able :: KRel8able -> Constraint
107class HTable (GRep t) => Rel8able t where
112class HTable (GRep t) => Rel8able t where
108 gfromColumns :: (Labelable context, Reifiable context)
113 gfromColumns :: (Labelable context, Reifiable context)
109 => GRep t (Col (Reify context)) -> t (Reify context)
114 => GRep t (Col (Reify context)) -> t (Reify context)