From 95d1a34e9491e399643c384bb807e538b6100ac1 Mon Sep 17 00:00:00 2001 From: Kei Hibino Date: Sun, 30 Apr 2017 23:08:44 +0900 Subject: [PATCH] relational-query: update haddock of ShowConstantTermsSQL. --- .../Relational/Query/ProjectableClass.hs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/relational-query/src/Database/Relational/Query/ProjectableClass.hs b/relational-query/src/Database/Relational/Query/ProjectableClass.hs index 5e182999..b125751b 100644 --- a/relational-query/src/Database/Relational/Query/ProjectableClass.hs +++ b/relational-query/src/Database/Relational/Query/ProjectableClass.hs @@ -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 () +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