diff options
author | Daniel Gröber <dxld@darkboxed.org> | 2018-01-12 19:47:07 +0100 |
---|---|---|
committer | Daniel Gröber <dxld@darkboxed.org> | 2018-01-18 14:10:26 +0100 |
commit | 79988a8a5c2e3c1f29ca1e20c2d4a258863cd106 (patch) | |
tree | e42df8082bc2721a506ffdb77c754247b2d2cb83 /src | |
parent | cb0f70b691e0913790739bda6b4528a79c9a0df0 (diff) |
Make PackageDbDir newtype accessor more conventional
Diffstat (limited to 'src')
-rw-r--r-- | src/CabalHelper/Compiletime/Compile.hs | 4 | ||||
-rw-r--r-- | src/CabalHelper/Compiletime/Types.hs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/CabalHelper/Compiletime/Compile.hs b/src/CabalHelper/Compiletime/Compile.hs index b956932..a96ded8 100644 --- a/src/CabalHelper/Compiletime/Compile.hs +++ b/src/CabalHelper/Compiletime/Compile.hs @@ -196,7 +196,7 @@ compile distdir opts@Options {..} Compile {..} = do \|| (major1) == "++show mj1++" && (major2) < "++show mj2++"\ \|| (major1) == "++show mj1++" && (major2) == "++show mj2++" && (minor) <= "++show mi++")" ], - maybeToList $ ("-package-conf="++) <$> packageDbDir <$> compPackageDb, + maybeToList $ ("-package-conf="++) <$> unPackageDbDir <$> compPackageDb, map ("-i"++) $ nub $ "":compCabalHelperSourceDir:maybeToList cnCabalSourceDir, if isNothing cnCabalSourceDir @@ -550,7 +550,7 @@ listCabalVersions opts = listCabalVersions' opts Nothing -- TODO: Include sandbox? Probably only relevant for build-type:custom projects. listCabalVersions' :: Options -> Maybe PackageDbDir -> IO [Version] listCabalVersions' Options {..} mdb = do - let mdbopt = ("--package-conf="++) <$> packageDbDir <$> mdb + let mdbopt = ("--package-conf="++) <$> unPackageDbDir <$> mdb opts = ["list", "--simple-output", "Cabal"] ++ maybeToList mdbopt catMaybes . map (fmap snd . parsePkgId . fromString) . words diff --git a/src/CabalHelper/Compiletime/Types.hs b/src/CabalHelper/Compiletime/Types.hs index cf36e49a..297f785 100644 --- a/src/CabalHelper/Compiletime/Types.hs +++ b/src/CabalHelper/Compiletime/Types.hs @@ -34,7 +34,7 @@ data Options = Options { , oCabalPkgDb :: Maybe PackageDbDir } -newtype PackageDbDir = PackageDbDir { packageDbDir :: FilePath } +newtype PackageDbDir = PackageDbDir { unPackageDbDir :: FilePath } defaultOptions :: Options defaultOptions = Options False "ghc" "ghc-pkg" "cabal" Nothing Nothing |