From 238491d9b5d35a1e5e44e5b34faade5f9b85effe Mon Sep 17 00:00:00 2001 From: Kei Hibino Date: Thu, 30 Mar 2017 15:47:37 +0900 Subject: [PATCH] relational-query: add ShowConstantTermsSQL instances of tuple types. --- relational-query/src/Database/Relational/Query/Pure.hs | 5 ----- .../src/Database/Relational/Query/TupleInstances.hs | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/relational-query/src/Database/Relational/Query/Pure.hs b/relational-query/src/Database/Relational/Query/Pure.hs index 9384c40a..4c1dfa60 100644 --- a/relational-query/src/Database/Relational/Query/Pure.hs +++ b/relational-query/src/Database/Relational/Query/Pure.hs @@ -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 diff --git a/relational-query/src/Database/Relational/Query/TupleInstances.hs b/relational-query/src/Database/Relational/Query/TupleInstances.hs index 662662f3..23521bf8 100644 --- a/relational-query/src/Database/Relational/Query/TupleInstances.hs +++ b/relational-query/src/Database/Relational/Query/TupleInstances.hs @@ -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.