mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2024-12-02 08:12:49 +03:00
relational-query: add ShowConstantTermsSQL instances of tuple types.
This commit is contained in:
parent
28135083ad
commit
238491d9b5
@ -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
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user