mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2024-11-30 01:24:29 +03:00
relational-query: update haddock of ShowConstantTermsSQL.
This commit is contained in:
parent
2f2042aef1
commit
95d1a34e94
@ -61,7 +61,23 @@ showConstantTermsSQL :: ShowConstantTermsSQL a
|
||||
-> [StringSQL]
|
||||
showConstantTermsSQL = toList . showConstantTermsSQL'
|
||||
|
||||
-- | Interface for constant SQL term list.
|
||||
{- |
|
||||
'ShowConstantTermsSQL' 'a' is implicit rule to derive function to convert
|
||||
from haskell record type 'a' into constant SQL terms.
|
||||
|
||||
Generic programming (<https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#generic-programming>)
|
||||
with default signature is available for 'ShowConstantTermsSQL' class,
|
||||
so you can make instance like below:
|
||||
|
||||
@
|
||||
\{\-\# LANGUAGE DeriveGeneric \#\-\}
|
||||
import GHC.Generics (Generic)
|
||||
--
|
||||
data Foo = Foo { ... } deriving Generic
|
||||
instance ShowConstantTermsSQL Foo
|
||||
@
|
||||
|
||||
-}
|
||||
class ShowConstantTermsSQL a where
|
||||
showConstantTermsSQL' :: a -> DList StringSQL
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user