From 6786d95ae84ad725fa11068714e2fcd62a3ed05c Mon Sep 17 00:00:00 2001 From: Kei Hibino Date: Wed, 20 Jun 2018 23:24:05 +0900 Subject: [PATCH] relational-query: simplified. --- relational-query/src/Database/Relational/TH.hs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/relational-query/src/Database/Relational/TH.hs b/relational-query/src/Database/Relational/TH.hs index 084a86db..c11d9e73 100644 --- a/relational-query/src/Database/Relational/TH.hs +++ b/relational-query/src/Database/Relational/TH.hs @@ -112,12 +112,10 @@ defineHasConstraintKeyInstance :: TypeQ -- ^ Constraint type -> TypeQ -- ^ Key type -> [Int] -- ^ Indexes specifies key -> Q [Dec] -- ^ Result 'HasConstraintKey' declaration -defineHasConstraintKeyInstance constraint recType colType indexes = do - -- kc <- defineHasColumnConstraintInstance constraint recType index - ck <- [d| instance HasConstraintKey $constraint $recType $colType where - constraintKey = unsafeDefineConstraintKey $(listE [integralE ix | ix <- indexes]) - |] - return ck +defineHasConstraintKeyInstance constraint recType colType indexes = + [d| instance HasConstraintKey $constraint $recType $colType where + constraintKey = unsafeDefineConstraintKey $(listE [integralE ix | ix <- indexes]) + |] -- | Rule template to infer primary key. defineHasPrimaryKeyInstance :: TypeQ -- ^ Record type