aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock
diff options
context:
space:
mode:
authoralexbiehl-gc <72160047+alexbiehl-gc@users.noreply.github.com>2021-02-07 18:30:40 +0100
committerGitHub <noreply@github.com>2021-02-07 18:30:40 +0100
commite90e79815960823a749287968fb1c6d09559a67f (patch)
tree9ab05e60afe92216991c5c5f3a39ca6a3fce8ae7 /haddock-api/src/Haddock
parentd20dcc3a61ec61860560216fe88e8dc26097fb35 (diff)
parent04da98934ad1c083d21ffc6a83a834c6c4b555d4 (diff)
Merge pull request #1322 from haskell/alex/forward-port
simplify calculating percentages fixing #1194 (#1236)
Diffstat (limited to 'haddock-api/src/Haddock')
-rw-r--r--haddock-api/src/Haddock/Interface.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/haddock-api/src/Haddock/Interface.hs b/haddock-api/src/Haddock/Interface.hs
index 1501919b..b68cc4a9 100644
--- a/haddock-api/src/Haddock/Interface.hs
+++ b/haddock-api/src/Haddock/Interface.hs
@@ -186,7 +186,7 @@ processModule verbosity modsum flags modMap instIfaceMap = do
liftIO $ mapM_ putStrLn (nub msgs)
dflags <- getDynFlags
let (haddockable, haddocked) = ifaceHaddockCoverage interface
- percentage = round (fromIntegral haddocked * 100 / fromIntegral haddockable :: Double) :: Int
+ percentage = div (haddocked * 100) haddockable
modString = moduleString (ifaceMod interface)
coverageMsg = printf " %3d%% (%3d /%3d) in '%s'" percentage haddocked haddockable modString
header = case ifaceDoc interface of
@@ -245,4 +245,3 @@ buildHomeLinks ifaces = foldl upd Map.empty (reverse ifaces)
mdl = ifaceMod iface
keep_old env n = Map.insertWith (\_ old -> old) n mdl env
keep_new env n = Map.insert n mdl env
-