relational-query: update haddock of ShowConstantTermsSQL.

This commit is contained in:
Kei Hibino 2017-04-30 23:08:44 +09:00
parent 2f2042aef1
commit 95d1a34e94

View File

@ -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