From af772cf52cef1c6f4892031ac7399aa0d8274146 Mon Sep 17 00:00:00 2001 From: Kei Hibino Date: Sun, 2 Jun 2013 15:25:27 +0900 Subject: [PATCH] Update definition order. --- DB-record/src/Database/Record/TH.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/DB-record/src/Database/Record/TH.hs b/DB-record/src/Database/Record/TH.hs index 3987cffc..2e2921c4 100644 --- a/DB-record/src/Database/Record/TH.hs +++ b/DB-record/src/Database/Record/TH.hs @@ -62,17 +62,17 @@ import Database.Record.Persistable import qualified Database.Record.Persistable as Persistable -defineHasKeyConstraintInstance :: TypeQ -> TypeQ -> Int -> Q [Dec] -defineHasKeyConstraintInstance constraint typeCon index = - [d| instance HasKeyConstraint $constraint $typeCon where - keyConstraint = specifyKeyConstraint $(integralE index) |] - recordTypeNameDefault :: String -> ConName recordTypeNameDefault = conCamelcaseName recordTypeDefault :: String -> TypeQ recordTypeDefault = toTypeCon . recordTypeNameDefault +defineHasKeyConstraintInstance :: TypeQ -> TypeQ -> Int -> Q [Dec] +defineHasKeyConstraintInstance constraint typeCon index = + [d| instance HasKeyConstraint $constraint $typeCon where + keyConstraint = specifyKeyConstraint $(integralE index) |] + defineHasNotNullKeyInstance :: TypeQ -> Int -> Q [Dec] defineHasNotNullKeyInstance = defineHasKeyConstraintInstance [t| NotNull |]