Skip to content

Commit

Permalink
make style: Format with fourmolu
Browse files Browse the repository at this point in the history
  • Loading branch information
FinleyMcIlwaine committed Aug 16, 2023
1 parent cbf6d02 commit 4cc5ca1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
16 changes: 7 additions & 9 deletions Cabal/src/Distribution/Simple/Haddock.hs
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,9 @@ haddock pkg_descr lbi suffixes flags' = do
_ -> targets

version' =
if flag haddockNoVersionCPP then
Nothing
else
Just version
if flag haddockNoVersionCPP
then Nothing
else Just version

internalPackageDB <-
createInternalPackageDB verbosity lbi (flag haddockDistPref)
Expand Down Expand Up @@ -388,7 +387,6 @@ haddock pkg_descr lbi suffixes flags' = do
}

return $ PackageIndex.insert ipi index

CFLib flib ->
when
(flag haddockForeignLibs)
Expand Down Expand Up @@ -711,9 +709,9 @@ getGhcCppOpts haddockVersion bi =
where
needsCpp = EnableExtension CPP `elem` usedExtensions bi
defines =
[ "-D__HADDOCK_VERSION__=" ++ show vn
| Just vn <- [versionInt . versionNumbers <$> haddockVersion]
]
[ "-D__HADDOCK_VERSION__=" ++ show vn
| Just vn <- [versionInt . versionNumbers <$> haddockVersion]
]
where
-- For some list xs = [x, y, z ...], versionInt xs results in
-- x * 1000 + y * 10 + z. E.g.:
Expand All @@ -724,7 +722,7 @@ getGhcCppOpts haddockVersion bi =
-- >>> versionInt []
-- 0
versionInt :: [Int] -> Int
versionInt = foldr ((+) . uncurry (*)) 0 . zip [1000,10,1]
versionInt = foldr ((+) . uncurry (*)) 0 . zip [1000, 10, 1]

getGhcLibDir
:: Verbosity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ data PackageConfig = PackageConfig
, packageConfigHaddockBaseUrl :: Flag String -- TODO: [required eventually] use this
, packageConfigHaddockResourcesDir :: Flag String -- TODO: [required eventually] use this
, packageConfigHaddockOutputDir :: Flag FilePath -- TODO: [required eventually] use this
, packageConfigHaddockNoVersionCPP:: Flag Bool -- TODO: [required eventually] use this
, packageConfigHaddockNoVersionCPP :: Flag Bool -- TODO: [required eventually] use this
, packageConfigHaddockForHackage :: Flag HaddockTarget
, -- Test options
packageConfigTestHumanLog :: Flag PathTemplate
Expand Down
7 changes: 3 additions & 4 deletions cabal-install/src/Distribution/Client/ProjectPlanning.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2205,10 +2205,9 @@ elaborateInstallPlan
-- `documentation: true` should imply `-haddock` for GHC
addHaddockIfDocumentationEnabled :: ConfiguredProgram -> ConfiguredProgram
addHaddockIfDocumentationEnabled cp@ConfiguredProgram{..} =
if programId == "ghc" && elabBuildHaddocks then
cp { programOverrideArgs = "-haddock" : programOverrideArgs }
else
cp
if programId == "ghc" && elabBuildHaddocks
then cp{programOverrideArgs = "-haddock" : programOverrideArgs}
else cp

elabPkgSourceLocation = srcloc
elabPkgSourceHash = Map.lookup pkgid sourcePackageHashes
Expand Down

0 comments on commit 4cc5ca1

Please sign in to comment.