From dce3d7fd2a8baf7ba3cf2cc88d6f5a624fad27b6 Mon Sep 17 00:00:00 2001 From: Kei Hibino Date: Thu, 9 May 2013 17:46:12 +0900 Subject: [PATCH] Cleaning up TH symbol imports. --- schema-th/src/Database/HDBC/Schema/IBMDB2.hs | 8 ++++---- schema-th/src/Database/HDBC/Schema/PostgreSQL.hs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/schema-th/src/Database/HDBC/Schema/IBMDB2.hs b/schema-th/src/Database/HDBC/Schema/IBMDB2.hs index 225dff96..4e64a205 100644 --- a/schema-th/src/Database/HDBC/Schema/IBMDB2.hs +++ b/schema-th/src/Database/HDBC/Schema/IBMDB2.hs @@ -22,7 +22,7 @@ import Data.Char (toUpper, toLower) import Data.Map (Map, fromList) import qualified Data.Map as Map import Data.Time (LocalTime, Day) -import Language.Haskell.TH (Q, Type) +import Language.Haskell.TH (TypeQ) import qualified Language.Haskell.TH.Name.Extra as TH import Database.HDBC (IConnection, SqlValue) @@ -129,7 +129,7 @@ $(defineRecordAndTableDefault [derivingShow]) -mapFromSqlDefault :: Map String (Q Type) +mapFromSqlDefault :: Map String TypeQ mapFromSqlDefault = fromList [("VARCHAR", [t|String|]), ("CHAR", [t|String|]), @@ -148,7 +148,7 @@ normalizeField = map toLower notNull :: Columns -> Bool notNull = (== "N") . nulls -getType :: Map String (Q Type) -> Columns -> (String, Q Type) +getType :: Map String TypeQ -> Columns -> (String, TypeQ) getType mapFromSql rec = (normalizeField $ colname rec, mayNull $ mapFromSql Map.! typename rec) @@ -217,7 +217,7 @@ getFields' :: IConnection conn -> conn -> String -> String - -> IO ([(String, Q Type)], [Int]) + -> IO ([(String, TypeQ)], [Int]) getFields' tmap conn scm' tbl' = do let tbl = map toUpper tbl' scm = map toUpper scm' diff --git a/schema-th/src/Database/HDBC/Schema/PostgreSQL.hs b/schema-th/src/Database/HDBC/Schema/PostgreSQL.hs index 06dbb070..a6bc6090 100644 --- a/schema-th/src/Database/HDBC/Schema/PostgreSQL.hs +++ b/schema-th/src/Database/HDBC/Schema/PostgreSQL.hs @@ -13,7 +13,7 @@ module Database.HDBC.Schema.PostgreSQL ( driverPostgreSQL ) where -import Language.Haskell.TH (Q, Type) +import Language.Haskell.TH (TypeQ) import qualified Language.Haskell.TH.Name.Extra as TH import Data.Int (Int16, Int32, Int64) @@ -42,7 +42,7 @@ import qualified Language.SQL.Keyword as SQL import Database.HDBC.Schema.Driver (TypeMap, Driver, getFieldsWithMap, getPrimaryKey, emptyDriver) -mapFromSqlDefault :: Map String (Q Type) +mapFromSqlDefault :: Map String TypeQ mapFromSqlDefault = fromList [("bool", [t| Bool |]), ("char", [t| String |]), @@ -82,7 +82,7 @@ type Column = (PgAttribute, PgType) notNull :: Column -> Bool notNull = Attr.attnotnull . fst -getType :: Map String (Q Type) -> Column -> (String, Q Type) +getType :: Map String TypeQ -> Column -> (String, TypeQ) getType mapFromSql column@(pgAttr, pgType) = (normalizeField $ Attr.attname pgAttr, mayNull $ mapFromSql ! Type.typname pgType) @@ -186,7 +186,7 @@ getFields' :: IConnection conn -> conn -> String -> String - -> IO ([(String, Q Type)], [Int]) + -> IO ([(String, TypeQ)], [Int]) getFields' tmap conn scm' tbl' = do let scm = map toLower scm' tbl = map toLower tbl'