From 2799cc04b621194af91cc0d3239467ab92867560 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Thu, 11 Oct 2018 22:45:18 +0200 Subject: Fix a couple of warnings --- src/CabalHelper/Shared/Common.hs | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/CabalHelper/Shared') diff --git a/src/CabalHelper/Shared/Common.hs b/src/CabalHelper/Shared/Common.hs index a7e7377..1f0c49e 100644 --- a/src/CabalHelper/Shared/Common.hs +++ b/src/CabalHelper/Shared/Common.hs @@ -28,6 +28,19 @@ module CabalHelper.Shared.Common where #define CH_MIN_VERSION_Cabal MIN_VERSION_Cabal #endif +import Distribution.PackageDescription + ( GenericPackageDescription + ) +import Distribution.Verbosity + ( Verbosity + ) + +#if CH_MIN_VERSION_Cabal(2,2,0) +import qualified Distribution.PackageDescription.Parsec as P +#else +import qualified Distribution.PackageDescription.Parse as P +#endif + import Control.Applicative import Control.Exception as E import Control.Monad @@ -39,11 +52,6 @@ import Data.Typeable import Data.ByteString (ByteString) import qualified Data.ByteString as BS import qualified Data.ByteString.Char8 as BS8 -#if CH_MIN_VERSION_Cabal(2,2,0) -import qualified Distribution.PackageDescription.Parsec as P -#else -import qualified Distribution.PackageDescription.Parse as P -#endif import System.Environment import System.IO import qualified System.Info @@ -143,7 +151,11 @@ replace n r hs' = go "" hs' go acc [] = reverse acc -#if CH_MIN_VERSION_Cabal(2,2,0) +readPackageDescription + :: Verbosity + -> FilePath + -> IO GenericPackageDescription +#if CH_MIN_VERSION_Cabal(2,0,0) readPackageDescription = P.readGenericPackageDescription #else readPackageDescription = P.readPackageDescription -- cgit v1.2.3