Skip to content

Commit

Permalink
Update PackageDBNT to use PackageDBCWD
Browse files Browse the repository at this point in the history
  • Loading branch information
jgotoh committed Sep 13, 2024
1 parent df4d85b commit 6a1eabe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cabal-install/src/Distribution/Client/ProjectConfig/Lens.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import Distribution.PackageDescription
import Distribution.Simple.Compiler
( DebugInfoLevel (..)
, OptimisationLevel (..)
, PackageDB
, PackageDBCWD
, ProfDetailLevel
)
import Distribution.Simple.InstallDirs
Expand Down Expand Up @@ -212,7 +212,7 @@ projectConfigInstallDirs :: Lens' ProjectConfigShared (InstallDirs (Flag PathTem
projectConfigInstallDirs f s = fmap (\x -> s{T.projectConfigInstallDirs = x}) (f (T.projectConfigInstallDirs s))
{-# INLINEABLE projectConfigInstallDirs #-}

projectConfigPackageDBs :: Lens' ProjectConfigShared [Maybe PackageDB]
projectConfigPackageDBs :: Lens' ProjectConfigShared [Maybe PackageDBCWD]
projectConfigPackageDBs f s = fmap (\x -> s{T.projectConfigPackageDBs = x}) (f (T.projectConfigPackageDBs s))
{-# INLINEABLE projectConfigPackageDBs #-}

Expand Down
8 changes: 4 additions & 4 deletions cabal-install/src/Distribution/Client/Utils/Newtypes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ import Distribution.Client.Types.AllowNewer (AllowNewer (..), AllowOlder (..))
import Distribution.Compat.CharParsing
import Distribution.Compat.Newtype
import Distribution.Parsec
import Distribution.Simple.Compiler (PackageDB (..), readPackageDb)
import Distribution.Simple.Compiler (PackageDBCWD, interpretPackageDB, readPackageDb)
import Distribution.Solver.Types.ConstraintSource (ConstraintSource (..))
import Network.URI (URI, parseURI)

newtype PackageDBNT = PackageDBNT {getPackageDBNT :: Maybe PackageDB}
newtype PackageDBNT = PackageDBNT {getPackageDBNT :: Maybe PackageDBCWD}

instance Newtype (Maybe PackageDB) PackageDBNT
instance Newtype (Maybe PackageDBCWD) PackageDBNT

instance Parsec PackageDBNT where
parsec = parsecPackageDB

parsecPackageDB :: CabalParsing m => m PackageDBNT
parsecPackageDB = PackageDBNT . readPackageDb <$> parsecToken
parsecPackageDB = PackageDBNT . fmap (interpretPackageDB Nothing) . readPackageDb <$> parsecToken

newtype NumJobs = NumJobs {getNumJobs :: Maybe Int}

Expand Down

0 comments on commit 6a1eabe

Please sign in to comment.