relational-query: add ShowConstantTermsSQL instances of tuple types.

This commit is contained in:
Kei Hibino 2017-03-30 15:47:37 +09:00
parent 28135083ad
commit 238491d9b5
2 changed files with 3 additions and 8 deletions

View File

@ -158,8 +158,3 @@ showMaybeTerms wa = d where
instance (PersistableWidth a, ShowConstantTermsSQL a)
=> ShowConstantTermsSQL (Maybe a) where
showConstantTermsSQL = showMaybeTerms persistableWidth
-- | Constant SQL terms of '(a, b)' type.
instance (ShowConstantTermsSQL a, ShowConstantTermsSQL b)
=> ShowConstantTermsSQL (a, b) where
showConstantTermsSQL (a, b) = showConstantTermsSQL a ++ showConstantTermsSQL b

View File

@ -18,11 +18,11 @@ module Database.Relational.Query.TupleInstances where
import Control.Applicative ((<$>))
import Database.Relational.Query.BaseTH (defineTuplePi, defineTupleProductConstructor)
import Database.Relational.Query.BaseTH
(defineTuplePi, defineTupleProductConstructor, defineTupleShowConstantInstance,)
$(concat <$> mapM defineTupleProductConstructor [2..7])
-- Generic instances of tuple types are generated from 2 to 7 in GHC.Generics.
$(concat <$> mapM defineTuplePi [2..7])
$(concat <$> mapM defineTupleShowConstantInstance [2..7])
-- Generic instances of tuple types are generated from 2 to 7 in GHC.Generics.