aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Options.hs
diff options
context:
space:
mode:
Diffstat (limited to 'haddock-api/src/Haddock/Options.hs')
-rw-r--r--haddock-api/src/Haddock/Options.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/haddock-api/src/Haddock/Options.hs b/haddock-api/src/Haddock/Options.hs
index 46db572b..e314bbd0 100644
--- a/haddock-api/src/Haddock/Options.hs
+++ b/haddock-api/src/Haddock/Options.hs
@@ -374,9 +374,10 @@ modulePackageInfo :: DynFlags
-> [Flag] -- ^ Haddock flags are checked as they may contain
-- the package name or version provided by the user
-- which we prioritise
- -> Module
+ -> Maybe Module
-> (Maybe PackageName, Maybe Data.Version.Version)
-modulePackageInfo dflags flags modu =
+modulePackageInfo _dflags _flags Nothing = (Nothing, Nothing)
+modulePackageInfo dflags flags (Just modu) =
( optPackageName flags <|> fmap packageName pkgDb
, optPackageVersion flags <|> fmap packageVersion pkgDb
)