summaryrefslogtreecommitdiff
path: root/utils/hpc
diff options
context:
space:
mode:
authorKavon Farvardin <kavon@farvard.in>2018-09-23 15:29:37 -0500
committerKavon Farvardin <kavon@farvard.in>2018-09-23 15:29:37 -0500
commit84c2ad99582391005b5e873198b15e9e9eb4f78d (patch)
treecaa8c2f2ec7e97fbb4977263c6817c9af5025cf4 /utils/hpc
parent8ddb47cfcf5776e9a3c55fd37947c8a95e00fa12 (diff)
parente68b439fe5de61b9a2ca51af472185c62ccb8b46 (diff)
downloadhaskell-wip/T13904.tar.gz
update to current master againwip/T13904
Diffstat (limited to 'utils/hpc')
-rw-r--r--utils/hpc/HpcMarkup.hs9
-rw-r--r--utils/hpc/hpc-bin.cabal2
2 files changed, 6 insertions, 5 deletions
diff --git a/utils/hpc/HpcMarkup.hs b/utils/hpc/HpcMarkup.hs
index ca30471ac4..a9b5ce1722 100644
--- a/utils/hpc/HpcMarkup.hs
+++ b/utils/hpc/HpcMarkup.hs
@@ -17,6 +17,7 @@ import System.FilePath
import System.IO (localeEncoding)
import Data.List
import Data.Maybe(fromJust)
+import Data.Semigroup as Semi
import Data.Array
import Control.Monad
import qualified Data.Set as Set
@@ -467,6 +468,9 @@ showSummary ticked total =
percent :: (Integral a) => a -> a -> Maybe a
percent ticked total = if total == 0 then Nothing else Just (ticked * 100 `div` total)
+instance Semi.Semigroup ModuleSummary where
+ (ModuleSummary eTik1 eTot1 tTik1 tTot1 aTik1 aTot1) <> (ModuleSummary eTik2 eTot2 tTik2 tTot2 aTik2 aTot2)
+ = ModuleSummary (eTik1 + eTik2) (eTot1 + eTot2) (tTik1 + tTik2) (tTot1 + tTot2) (aTik1 + aTik2) (aTot1 + aTot2)
instance Monoid ModuleSummary where
mempty = ModuleSummary
@@ -477,10 +481,7 @@ instance Monoid ModuleSummary where
, altTicked = 0
, altTotal = 0
}
- mappend (ModuleSummary eTik1 eTot1 tTik1 tTot1 aTik1 aTot1)
- (ModuleSummary eTik2 eTot2 tTik2 tTot2 aTik2 aTot2)
- = ModuleSummary (eTik1 + eTik2) (eTot1 + eTot2) (tTik1 + tTik2) (tTot1 + tTot2) (aTik1 + aTik2) (aTot1 + aTot2)
-
+ mappend = (<>)
------------------------------------------------------------------------------
diff --git a/utils/hpc/hpc-bin.cabal b/utils/hpc/hpc-bin.cabal
index e83a45d1f2..a1368cf8d0 100644
--- a/utils/hpc/hpc-bin.cabal
+++ b/utils/hpc/hpc-bin.cabal
@@ -31,7 +31,7 @@ Executable hpc
Build-Depends: base >= 4 && < 5,
directory >= 1 && < 1.4,
filepath >= 1 && < 1.5,
- containers >= 0.1 && < 0.6,
+ containers >= 0.1 && < 0.7,
array >= 0.1 && < 0.6,
hpc