aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Options.hs
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-04-29 12:36:37 -0400
committerGitHub <noreply@github.com>2020-04-29 12:36:37 -0400
commit66faa532d4e3d93e87c5b042bef82d631dc74eb5 (patch)
tree971e9594725d0c6c798161aaee22054b9c696356 /haddock-api/src/Haddock/Options.hs
parent7c34f89d801bafba3162bc091dd486cbb9e9fd5b (diff)
parenta61dbdb0a7420e15e978bce6c09de1ce99290f44 (diff)
Merge pull request #1183 from hsyl20/wip/hsyl20/unitid
Refactoring of Unit code
Diffstat (limited to 'haddock-api/src/Haddock/Options.hs')
-rw-r--r--haddock-api/src/Haddock/Options.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/haddock-api/src/Haddock/Options.hs b/haddock-api/src/Haddock/Options.hs
index cccca201..011a361d 100644
--- a/haddock-api/src/Haddock/Options.hs
+++ b/haddock-api/src/Haddock/Options.hs
@@ -45,10 +45,10 @@ import Data.Version
import Control.Applicative
import Distribution.Verbosity
import GHC.Data.FastString
-import GHC ( DynFlags, Module, moduleUnitId )
+import GHC ( DynFlags, Module, moduleUnit )
import Haddock.Types
import Haddock.Utils
-import GHC.Driver.Packages
+import GHC.Unit.State
import System.Console.GetOpt
import qualified Text.ParserCombinators.ReadP as RP
@@ -378,8 +378,8 @@ modulePackageInfo :: DynFlags
-> (Maybe PackageName, Maybe Data.Version.Version)
modulePackageInfo _dflags _flags Nothing = (Nothing, Nothing)
modulePackageInfo dflags flags (Just modu) =
- ( optPackageName flags <|> fmap packageName pkgDb
- , optPackageVersion flags <|> fmap packageVersion pkgDb
+ ( optPackageName flags <|> fmap unitPackageName pkgDb
+ , optPackageVersion flags <|> fmap unitPackageVersion pkgDb
)
where
- pkgDb = lookupUnit dflags (moduleUnitId modu)
+ pkgDb = lookupUnit dflags (moduleUnit modu)