From: Michael Orlitzky Date: Sun, 2 Feb 2020 05:35:24 +0000 (-0500) Subject: src,test: use explicit import/export lists. X-Git-Tag: 0.0.3~3 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=1585e5bef7e46666a8f026a00884323c9834565b;p=mailbox-count.git src,test: use explicit import/export lists. --- diff --git a/src/CommandLine.hs b/src/CommandLine.hs index 6fb30fe..1fddca0 100644 --- a/src/CommandLine.hs +++ b/src/CommandLine.hs @@ -16,7 +16,18 @@ import System.Console.CmdArgs ( import Paths_mailbox_count ( version ) import Data.Version ( showVersion ) -import OptionalConfiguration ( OptionalConfiguration(..) ) +import OptionalConfiguration ( + OptionalConfiguration( + OptionalConfiguration, + database, + detail, + detail_query, + host, + password, + port, + summary_query, + username ) + ) description :: String diff --git a/src/Configuration.hs b/src/Configuration.hs index f07be70..7e15a74 100644 --- a/src/Configuration.hs +++ b/src/Configuration.hs @@ -7,7 +7,7 @@ module Configuration ( merge_optional ) where -import System.Console.CmdArgs.Default ( Default(..) ) +import System.Console.CmdArgs.Default ( Default( def ) ) import qualified OptionalConfiguration as OC ( OptionalConfiguration(..), diff --git a/src/Main.hs b/src/Main.hs index d1d1ea8..2c225ae 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -1,19 +1,21 @@ {-# LANGUAGE DoAndIfThenElse #-} {-# LANGUAGE NoMonomorphismRestriction #-} -module Main +module Main ( main ) where import Data.Maybe ( fromMaybe ) import Data.Monoid ( (<>) ) import Data.String.Utils ( join ) -import Database.HDBC ( SqlError(..), handleSql ) +import Database.HDBC ( SqlError( seNativeError, seErrorMsg ), handleSql ) import Database.HDBC.PostgreSQL ( connectPostgreSQL ) import Database.HDBC.Sqlite3 ( connectSqlite3 ) import System.Console.CmdArgs ( def ) import System.Directory ( doesFileExist ) import System.IO ( hPutStrLn, stderr ) import CommandLine ( get_args ) -import Configuration ( Configuration(..), merge_optional ) +import Configuration ( + Configuration( host, port, username, password, database ), + merge_optional ) import qualified OptionalConfiguration as OC ( from_rc ) import Report ( report ) diff --git a/src/OptionalConfiguration.hs b/src/OptionalConfiguration.hs index 16a61bf..4faff20 100644 --- a/src/OptionalConfiguration.hs +++ b/src/OptionalConfiguration.hs @@ -20,8 +20,8 @@ import qualified Data.Configurator as DC ( lookup ) import Data.Data ( Data ) import Data.Typeable ( Typeable ) -import Data.Monoid ( Monoid(..) ) -import Data.Semigroup ( Semigroup( (<>) ) ) +import Data.Monoid ( Monoid() ) +import Data.Semigroup ( Semigroup() ) import Paths_mailbox_count ( getSysconfDir ) import System.Directory ( getHomeDirectory ) import System.FilePath ( () ) diff --git a/src/Report.hs b/src/Report.hs index f1ec9dd..96c3150 100644 --- a/src/Report.hs +++ b/src/Report.hs @@ -15,11 +15,11 @@ import Database.HDBC ( safeFromSql, quickQuery ) import Database.HDBC.Sqlite3 ( connectSqlite3 ) -import System.Console.CmdArgs.Default ( Default(..) ) +import System.Console.CmdArgs.Default ( Default( def ) ) import Test.Tasty ( TestTree, testGroup ) import Test.Tasty.HUnit ( (@?=), testCase ) -import Configuration ( Configuration(..) ) +import Configuration ( Configuration( detail, detail_query, summary_query ) ) -- Type synonyms to make the signatures below a little more clear. type Domain = String diff --git a/test/Doctests.hs b/test/Doctests.hs index d183b4b..83bc612 100644 --- a/test/Doctests.hs +++ b/test/Doctests.hs @@ -1,7 +1,7 @@ -module Main +module Main ( main ) where -import Test.DocTest +import Test.DocTest ( doctest ) import System.FilePath.Find ((==?), always, extension, find) find_sources :: IO [FilePath]