Skip to content

Commit

Permalink
Switch to ImportQualifiedPost
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-volkov committed Apr 19, 2024
1 parent 2edcd36 commit f2f747e
Show file tree
Hide file tree
Showing 31 changed files with 110 additions and 109 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fail-fast: false
matrix:
include:
- ghc: 8.8.1
- ghc: 8.10.1
ghc-options: ""
ignore-haddock: "true"
- ghc: latest
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ module Main where

import Criterion
import Criterion.Main
import qualified Hasql.Connection as A
import qualified Hasql.Decoders as D
import qualified Hasql.Session as B
import qualified Hasql.Statement as C
import Hasql.Connection qualified as A
import Hasql.Decoders qualified as D
import Hasql.Session qualified as B
import Hasql.Statement qualified as C
import Prelude

main :: IO ()
Expand Down
3 changes: 2 additions & 1 deletion hasql.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ common base
FunctionalDependencies
GADTs
GeneralizedNewtypeDeriving
ImportQualifiedPost
LambdaCase
LiberalTypeSynonyms
MagicHash
Expand Down Expand Up @@ -110,7 +111,7 @@ library
build-depends:
, aeson >=2 && <3
, attoparsec >=0.10 && <0.15
, base >=4.13 && <5
, base >=4.14 && <5
, bytestring >=0.10 && <0.13
, bytestring-strict-builder >=0.4.5.1 && <0.5
, contravariant >=1.3 && <2
Expand Down
4 changes: 2 additions & 2 deletions library/Hasql/Commands.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ module Hasql.Commands
)
where

import qualified Data.ByteString.Builder as BB
import qualified Data.ByteString.Lazy as BL
import Data.ByteString.Builder qualified as BB
import Data.ByteString.Lazy qualified as BL
import Hasql.Prelude

newtype Commands
Expand Down
8 changes: 4 additions & 4 deletions library/Hasql/Connection/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
-- This module provides a low-level effectful API dealing with the connections to the database.
module Hasql.Connection.Core where

import qualified Database.PostgreSQL.LibPQ as LibPQ
import qualified Hasql.IO as IO
import Database.PostgreSQL.LibPQ qualified as LibPQ
import Hasql.IO qualified as IO
import Hasql.Prelude
import qualified Hasql.PreparedStatementRegistry as PreparedStatementRegistry
import qualified Hasql.Settings as Settings
import Hasql.PreparedStatementRegistry qualified as PreparedStatementRegistry
import Hasql.Settings qualified as Settings

-- |
-- A single connection to the database.
Expand Down
22 changes: 11 additions & 11 deletions library/Hasql/Decoders/All.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
-- A DSL for declaration of result decoders.
module Hasql.Decoders.All where

import qualified Data.Aeson as Aeson
import qualified Data.Vector.Generic as GenericVector
import qualified Hasql.Decoders.Array as Array
import qualified Hasql.Decoders.Composite as Composite
import qualified Hasql.Decoders.Result as Result
import qualified Hasql.Decoders.Results as Results
import qualified Hasql.Decoders.Row as Row
import qualified Hasql.Decoders.Value as Value
import Data.Aeson qualified as Aeson
import Data.Vector.Generic qualified as GenericVector
import Hasql.Decoders.Array qualified as Array
import Hasql.Decoders.Composite qualified as Composite
import Hasql.Decoders.Result qualified as Result
import Hasql.Decoders.Results qualified as Results
import Hasql.Decoders.Row qualified as Row
import Hasql.Decoders.Value qualified as Value
import Hasql.Prelude hiding (bool, maybe)
import qualified Hasql.Prelude as Prelude
import qualified Network.IP.Addr as NetworkIp
import qualified PostgreSQL.Binary.Decoding as A
import Hasql.Prelude qualified as Prelude
import Network.IP.Addr qualified as NetworkIp
import PostgreSQL.Binary.Decoding qualified as A

-- * Result

Expand Down
2 changes: 1 addition & 1 deletion library/Hasql/Decoders/Array.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Hasql.Decoders.Array where

import Hasql.Prelude
import qualified PostgreSQL.Binary.Decoding as A
import PostgreSQL.Binary.Decoding qualified as A

newtype Array a
= Array (ReaderT Bool A.Array a)
Expand Down
2 changes: 1 addition & 1 deletion library/Hasql/Decoders/Composite.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Hasql.Decoders.Composite where

import Hasql.Prelude
import qualified PostgreSQL.Binary.Decoding as A
import PostgreSQL.Binary.Decoding qualified as A

newtype Composite a
= Composite (ReaderT Bool A.Composite a)
Expand Down
14 changes: 7 additions & 7 deletions library/Hasql/Decoders/Result.hs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module Hasql.Decoders.Result where

import qualified Data.Attoparsec.ByteString.Char8 as Attoparsec
import qualified Data.ByteString as ByteString
import qualified Data.Vector as Vector
import qualified Data.Vector.Mutable as MutableVector
import qualified Database.PostgreSQL.LibPQ as LibPQ
import qualified Hasql.Decoders.Row as Row
import Data.Attoparsec.ByteString.Char8 qualified as Attoparsec
import Data.ByteString qualified as ByteString
import Data.Vector qualified as Vector
import Data.Vector.Mutable qualified as MutableVector
import Database.PostgreSQL.LibPQ qualified as LibPQ
import Hasql.Decoders.Row qualified as Row
import Hasql.Errors
import Hasql.Prelude hiding (many, maybe)
import qualified Hasql.Prelude as Prelude
import Hasql.Prelude qualified as Prelude

newtype Result a
= Result (ReaderT (Bool, LibPQ.Result) (ExceptT ResultError IO) a)
Expand Down
6 changes: 3 additions & 3 deletions library/Hasql/Decoders/Results.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
-- * Row-by-row fetching.
module Hasql.Decoders.Results where

import qualified Database.PostgreSQL.LibPQ as LibPQ
import qualified Hasql.Decoders.Result as Result
import Database.PostgreSQL.LibPQ qualified as LibPQ
import Hasql.Decoders.Result qualified as Result
import Hasql.Errors
import Hasql.Prelude hiding (many, maybe)
import qualified Hasql.Prelude as Prelude
import Hasql.Prelude qualified as Prelude

newtype Results a
= Results (ReaderT (Bool, LibPQ.Connection) (ExceptT CommandError IO) a)
Expand Down
6 changes: 3 additions & 3 deletions library/Hasql/Decoders/Row.hs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module Hasql.Decoders.Row where

import qualified Database.PostgreSQL.LibPQ as LibPQ
import qualified Hasql.Decoders.Value as Value
import Database.PostgreSQL.LibPQ qualified as LibPQ
import Hasql.Decoders.Value qualified as Value
import Hasql.Errors
import Hasql.Prelude hiding (error)
import qualified PostgreSQL.Binary.Decoding as A
import PostgreSQL.Binary.Decoding qualified as A

newtype Row a
= Row (ReaderT Env (ExceptT RowError IO) a)
Expand Down
2 changes: 1 addition & 1 deletion library/Hasql/Decoders/Value.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Hasql.Decoders.Value where

import Hasql.Prelude
import qualified PostgreSQL.Binary.Decoding as A
import PostgreSQL.Binary.Decoding qualified as A

newtype Value a
= Value (Bool -> A.Value a)
Expand Down
20 changes: 10 additions & 10 deletions library/Hasql/Encoders/All.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
-- A DSL for declaration of query parameter encoders.
module Hasql.Encoders.All where

import qualified Data.Aeson as Aeson
import qualified Data.ByteString.Lazy as LazyByteString
import qualified Hasql.Encoders.Array as Array
import qualified Hasql.Encoders.Params as Params
import qualified Hasql.Encoders.Value as Value
import qualified Hasql.PostgresTypeInfo as PTI
import Data.Aeson qualified as Aeson
import Data.ByteString.Lazy qualified as LazyByteString
import Hasql.Encoders.Array qualified as Array
import Hasql.Encoders.Params qualified as Params
import Hasql.Encoders.Value qualified as Value
import Hasql.PostgresTypeInfo qualified as PTI
import Hasql.Prelude hiding (bool)
import qualified Hasql.Prelude as Prelude
import qualified Network.IP.Addr as NetworkIp
import qualified PostgreSQL.Binary.Encoding as A
import qualified Text.Builder as C
import Hasql.Prelude qualified as Prelude
import Network.IP.Addr qualified as NetworkIp
import PostgreSQL.Binary.Encoding qualified as A
import Text.Builder qualified as C

-- * Parameters Product Encoder

Expand Down
6 changes: 3 additions & 3 deletions library/Hasql/Encoders/Array.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module Hasql.Encoders.Array where

import qualified Hasql.PostgresTypeInfo as B
import Hasql.PostgresTypeInfo qualified as B
import Hasql.Prelude
import qualified PostgreSQL.Binary.Encoding as A
import qualified Text.Builder as C
import PostgreSQL.Binary.Encoding qualified as A
import Text.Builder qualified as C

data Array a
= Array B.OID B.OID (Bool -> a -> A.Array) (a -> C.Builder)
Expand Down
10 changes: 5 additions & 5 deletions library/Hasql/Encoders/Params.hs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module Hasql.Encoders.Params where

import qualified Database.PostgreSQL.LibPQ as A
import qualified Hasql.Encoders.Value as C
import qualified Hasql.PostgresTypeInfo as D
import Database.PostgreSQL.LibPQ qualified as A
import Hasql.Encoders.Value qualified as C
import Hasql.PostgresTypeInfo qualified as D
import Hasql.Prelude
import qualified PostgreSQL.Binary.Encoding as B
import qualified Text.Builder as E
import PostgreSQL.Binary.Encoding qualified as B
import Text.Builder qualified as E

-- |
-- Encoder of some representation of a parameters product.
Expand Down
6 changes: 3 additions & 3 deletions library/Hasql/Encoders/Value.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module Hasql.Encoders.Value where

import qualified Hasql.PostgresTypeInfo as PTI
import Hasql.PostgresTypeInfo qualified as PTI
import Hasql.Prelude
import qualified PostgreSQL.Binary.Encoding as B
import qualified Text.Builder as C
import PostgreSQL.Binary.Encoding qualified as B
import Text.Builder qualified as C

data Value a
= Value PTI.OID PTI.OID (Bool -> a -> B.Encoding) (a -> C.Builder)
Expand Down
2 changes: 1 addition & 1 deletion library/Hasql/Errors.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
-- * Row-by-row fetching.
module Hasql.Errors where

import qualified Data.ByteString.Char8 as BC
import Data.ByteString.Char8 qualified as BC
import Hasql.Prelude

-- |
Expand Down
12 changes: 6 additions & 6 deletions library/Hasql/IO.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
-- An API of low-level IO operations.
module Hasql.IO where

import qualified Database.PostgreSQL.LibPQ as LibPQ
import qualified Hasql.Commands as Commands
import qualified Hasql.Decoders.Result as ResultDecoders
import qualified Hasql.Decoders.Results as ResultsDecoders
import qualified Hasql.Encoders.Params as ParamsEncoders
import Database.PostgreSQL.LibPQ qualified as LibPQ
import Hasql.Commands qualified as Commands
import Hasql.Decoders.Result qualified as ResultDecoders
import Hasql.Decoders.Results qualified as ResultsDecoders
import Hasql.Encoders.Params qualified as ParamsEncoders
import Hasql.Errors
import Hasql.Prelude
import qualified Hasql.PreparedStatementRegistry as PreparedStatementRegistry
import Hasql.PreparedStatementRegistry qualified as PreparedStatementRegistry

{-# INLINE acquireConnection #-}
acquireConnection :: ByteString -> IO LibPQ.Connection
Expand Down
2 changes: 1 addition & 1 deletion library/Hasql/PostgresTypeInfo.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Hasql.PostgresTypeInfo where

import qualified Database.PostgreSQL.LibPQ as LibPQ
import Database.PostgreSQL.LibPQ qualified as LibPQ
import Hasql.Prelude hiding (bool)

-- | A Postgresql type info
Expand Down
8 changes: 4 additions & 4 deletions library/Hasql/Prelude.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import Data.Bifunctor as Exports
import Data.Bits as Exports
import Data.Bool as Exports
import Data.ByteString as Exports (ByteString)
import qualified Data.ByteString.Builder
import qualified Data.ByteString.Lazy
import Data.ByteString.Builder qualified
import Data.ByteString.Lazy qualified
import Data.Char as Exports
import Data.Coerce as Exports
import Data.Complex as Exports
Expand Down Expand Up @@ -68,8 +68,8 @@ import Data.Scientific as Exports (Scientific)
import Data.Semigroup as Exports hiding (First (..), Last (..))
import Data.String as Exports
import Data.Text as Exports (Text)
import qualified Data.Text.Lazy
import qualified Data.Text.Lazy.Builder
import Data.Text.Lazy qualified
import Data.Text.Lazy.Builder qualified
import Data.Time as Exports
import Data.Traversable as Exports
import Data.Tuple as Exports
Expand Down
4 changes: 2 additions & 2 deletions library/Hasql/PreparedStatementRegistry.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ module Hasql.PreparedStatementRegistry
)
where

import qualified ByteString.StrictBuilder as B
import qualified Data.HashTable.IO as A
import ByteString.StrictBuilder qualified as B
import Data.HashTable.IO qualified as A
import Hasql.Prelude hiding (lookup)

data PreparedStatementRegistry
Expand Down
14 changes: 7 additions & 7 deletions library/Hasql/Session/Core.hs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module Hasql.Session.Core where

import qualified Hasql.Connection.Core as Connection
import qualified Hasql.Decoders.Result as Decoders.Result
import qualified Hasql.Decoders.Results as Decoders.Results
import qualified Hasql.Encoders.All as Encoders
import qualified Hasql.Encoders.Params as Encoders.Params
import Hasql.Connection.Core qualified as Connection
import Hasql.Decoders.Result qualified as Decoders.Result
import Hasql.Decoders.Results qualified as Decoders.Results
import Hasql.Encoders.All qualified as Encoders
import Hasql.Encoders.Params qualified as Encoders.Params
import Hasql.Errors
import qualified Hasql.IO as IO
import Hasql.IO qualified as IO
import Hasql.Prelude
import qualified Hasql.Statement as Statement
import Hasql.Statement qualified as Statement

-- |
-- A batch of actions to be executed in the context of a database connection.
Expand Down
6 changes: 3 additions & 3 deletions library/Hasql/Settings.hs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module Hasql.Settings where

import qualified Data.ByteString as B
import qualified Data.ByteString.Builder as BB
import qualified Data.ByteString.Lazy as BL
import Data.ByteString qualified as B
import Data.ByteString.Builder qualified as BB
import Data.ByteString.Lazy qualified as BL
import Hasql.Prelude

-- |
Expand Down
6 changes: 3 additions & 3 deletions library/Hasql/Statement.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ module Hasql.Statement
)
where

import qualified Hasql.Decoders as Decoders
import qualified Hasql.Decoders.All as Decoders
import qualified Hasql.Encoders as Encoders
import Hasql.Decoders qualified as Decoders
import Hasql.Decoders.All qualified as Decoders
import Hasql.Encoders qualified as Encoders
import Hasql.Prelude

-- |
Expand Down
10 changes: 5 additions & 5 deletions profiling/Main.hs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module Main where

import qualified Data.Vector as F
import qualified Hasql.Connection as A
import qualified Hasql.Decoders as D
import qualified Hasql.Session as B
import qualified Hasql.Statement as C
import Data.Vector qualified as F
import Hasql.Connection qualified as A
import Hasql.Decoders qualified as D
import Hasql.Session qualified as B
import Hasql.Statement qualified as C
import Prelude

main :: IO ()
Expand Down
Loading

0 comments on commit f2f747e

Please sign in to comment.