mirror of
https://github.com/circuithub/rel8.git
synced 2024-09-11 16:05:41 +03:00
Add and export KRel8able
This commit is contained in:
parent
04fdf2732d
commit
242dc79996
@ -26,7 +26,7 @@ module Rel8
|
|||||||
, DBFractional
|
, DBFractional
|
||||||
|
|
||||||
-- * Tables and higher-kinded tables
|
-- * Tables and higher-kinded tables
|
||||||
, Rel8able
|
, Rel8able, KRel8able
|
||||||
, Column, Field, Necessity( Required, Optional )
|
, Column, Field, Necessity( Required, Optional )
|
||||||
, Default
|
, Default
|
||||||
, HMaybe
|
, HMaybe
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
module Rel8.Schema.Generic
|
module Rel8.Schema.Generic
|
||||||
( Rel8able
|
( Rel8able
|
||||||
|
, KRel8able
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
|
|
||||||
@ -61,6 +62,10 @@ instance
|
|||||||
toColumns = hunreify . gtoColumns . reify
|
toColumns = hunreify . gtoColumns . reify
|
||||||
|
|
||||||
|
|
||||||
|
type KRel8able :: Type
|
||||||
|
type KRel8able = K.Table
|
||||||
|
|
||||||
|
|
||||||
-- | This type class allows you to define custom 'Table's using higher-kinded
|
-- | This type class allows you to define custom 'Table's using higher-kinded
|
||||||
-- data types. Higher-kinded data types are data types of the pattern:
|
-- data types. Higher-kinded data types are data types of the pattern:
|
||||||
--
|
--
|
||||||
@ -103,7 +108,7 @@ instance
|
|||||||
-- data MyType f = MyType { fieldA :: Column f T }
|
-- data MyType f = MyType { fieldA :: Column f T }
|
||||||
-- deriving ( GHC.Generics.Generic, Rel8able )
|
-- deriving ( GHC.Generics.Generic, Rel8able )
|
||||||
-- @
|
-- @
|
||||||
type Rel8able :: K.Table -> Constraint
|
type Rel8able :: KRel8able -> Constraint
|
||||||
class HTable (GRep t) => Rel8able t where
|
class HTable (GRep t) => Rel8able t where
|
||||||
gfromColumns :: (Labelable context, Reifiable context)
|
gfromColumns :: (Labelable context, Reifiable context)
|
||||||
=> GRep t (Col (Reify context)) -> t (Reify context)
|
=> GRep t (Col (Reify context)) -> t (Reify context)
|
||||||
|
Loading…
Reference in New Issue
Block a user