Skip to content

Commit a9695cc

Browse files
committed
clean imports
1 parent 71be839 commit a9695cc

File tree

4 files changed

+21
-59
lines changed

4 files changed

+21
-59
lines changed

src/Database/PostgreSQL/Query/TH.hs

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,20 @@
11
module Database.PostgreSQL.Query.TH
2-
( -- * Deriving instances
3-
deriveFromRow
4-
, deriveToRow
5-
, deriveEntity
6-
, deriveEverything
7-
, EntityOptions(..)
8-
-- * Sql string interpolation
9-
, sqlExp
10-
, sqlExpEmbed
11-
, sqlExpFile
2+
( -- * Deriving instances
3+
deriveEverything
124

13-
, module Database.PostgreSQL.Query.TH.Enum
14-
) where
5+
, module Database.PostgreSQL.Query.TH.Entity
6+
, module Database.PostgreSQL.Query.TH.Enum
7+
, module Database.PostgreSQL.Query.TH.Row
8+
, module Database.PostgreSQL.Query.TH.SqlExp
9+
) where
1510

1611
import Prelude
1712

18-
import Control.Applicative
19-
import Control.Monad
20-
import Data.Default
21-
import Data.FileEmbed ( embedFile )
22-
import Data.String
23-
import Database.PostgreSQL.Query.Entity ( Entity(..) )
2413
import Database.PostgreSQL.Query.TH.Entity
2514
import Database.PostgreSQL.Query.TH.Enum
2615
import Database.PostgreSQL.Query.TH.Row
2716
import Database.PostgreSQL.Query.TH.SqlExp
28-
import Database.PostgreSQL.Query.Types ( FN(..) )
29-
import Database.PostgreSQL.Simple.FromRow ( FromRow(..), field )
30-
import Database.PostgreSQL.Simple.ToRow ( ToRow(..) )
31-
import Database.PostgreSQL.Simple.Types ( Query(..) )
3217
import Language.Haskell.TH
33-
import Language.Haskell.TH.Syntax
34-
35-
3618

3719
{- | Calls sequently `deriveFromRow` `deriveToRow` `deriveEntity`. E.g. code like this:
3820

src/Database/PostgreSQL/Query/TH/Common.hs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
1-
module Database.PostgreSQL.Query.TH.Common where
1+
module Database.PostgreSQL.Query.TH.Common
2+
( cName
3+
, cArgs
4+
, cFieldNames
5+
, lookupVNameErr
6+
) where
27

38
import Prelude
49

5-
import Control.Applicative
6-
import Control.Monad
7-
import Data.Default
8-
import Data.FileEmbed ( embedFile )
9-
import Data.String
10-
import Database.PostgreSQL.Query.Entity ( Entity(..) )
11-
import Database.PostgreSQL.Query.Types ( FN(..) )
12-
import Database.PostgreSQL.Simple.FromRow ( FromRow(..), field )
13-
import Database.PostgreSQL.Simple.ToRow ( ToRow(..) )
14-
import Database.PostgreSQL.Simple.Types ( Query(..) )
1510
import Language.Haskell.TH
16-
import Language.Haskell.TH.Syntax
1711

1812
-- | Return constructor name
1913
cName :: (Monad m) => Con -> m Name

src/Database/PostgreSQL/Query/TH/Entity.hs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
1-
module Database.PostgreSQL.Query.TH.Entity where
1+
module Database.PostgreSQL.Query.TH.Entity
2+
( EntityOptions(..)
3+
, deriveEntity
4+
) where
25

36
import Prelude
47

5-
import Database.PostgreSQL.Query.TH.Enum
6-
7-
import Control.Applicative
8-
import Control.Monad
98
import Data.Default
10-
import Data.FileEmbed ( embedFile )
119
import Data.String
1210
import Database.PostgreSQL.Query.Entity ( Entity(..) )
1311
import Database.PostgreSQL.Query.TH.Common
1412
import Database.PostgreSQL.Query.Types ( FN(..) )
15-
import Database.PostgreSQL.Simple.FromRow ( FromRow(..), field )
16-
import Database.PostgreSQL.Simple.ToRow ( ToRow(..) )
17-
import Database.PostgreSQL.Simple.Types ( Query(..) )
1813
import Language.Haskell.TH
1914
import Language.Haskell.TH.Syntax
2015

21-
2216
-- | Options for deriving `Entity`
2317
data EntityOptions = EntityOptions
2418
{ eoTableName :: String -> String -- ^ Type name to table name converter

src/Database/PostgreSQL/Query/TH/Row.hs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
1-
module Database.PostgreSQL.Query.TH.Row where
1+
module Database.PostgreSQL.Query.TH.Row
2+
( deriveFromRow
3+
, deriveToRow
4+
) where
25

36
import Prelude
47

5-
import Database.PostgreSQL.Query.TH.Enum
6-
7-
import Control.Applicative
8-
import Control.Monad
9-
import Data.Default
10-
import Data.FileEmbed ( embedFile )
11-
import Data.String
12-
import Database.PostgreSQL.Query.Entity ( Entity(..) )
138
import Database.PostgreSQL.Query.TH.Common
14-
import Database.PostgreSQL.Query.Types ( FN(..) )
159
import Database.PostgreSQL.Simple.FromRow ( FromRow(..), field )
1610
import Database.PostgreSQL.Simple.ToRow ( ToRow(..) )
17-
import Database.PostgreSQL.Simple.Types ( Query(..) )
1811
import Language.Haskell.TH
19-
import Language.Haskell.TH.Syntax
2012

2113

2214
{-| Derive 'FromRow' instance. i.e. you have type like that

0 commit comments

Comments
 (0)