@@ -125,6 +125,7 @@ import Data.IORef
125125 (IORef, modifyIORef, newIORef, readIORef, writeIORef, atomicModifyIORef)
126126import Data.List ((\\))
127127import Data.Maybe (fromJust)
128+import Data.Semigroup ((<>))
128129import Data.Set (Set)
129130import GHC.Conc (ThreadId(..))
130131import GHC.Exts
@@ -621,34 +622,34 @@ dumpSVarStats sv ss style = do
621622 else return (0, 0, 0)
622623
623624 return $ unlines
624− [ "total dispatches = " ++ show dispatches
625− , "max workers = " ++ show maxWrk
626− , "max outQSize = " ++ show maxOq
627− ++ (if style == AheadVar
628− then "\nheap max size = " ++ show maxHp
625+ [ "total dispatches = " <> show dispatches
626+ , "max workers = " <> show maxWrk
627+ , "max outQSize = " <> show maxOq
628+ <> (if style == AheadVar
629+ then "\nheap max size = " <> show maxHp
629630 else "")
630− ++ (if minLat > 0
631+ <> (if minLat > 0
631632 then "\nmin worker latency = "
632− ++ secs (fromIntegral minLat * 1e-9)
633+ <> secs (fromIntegral minLat * 1e-9)
633634 else "")
634− ++ (if maxLat > 0
635+ <> (if maxLat > 0
635636 then "\nmax worker latency = "
636− ++ secs (fromIntegral maxLat * 1e-9)
637+ <> secs (fromIntegral maxLat * 1e-9)
637638 else "")
638− ++ (if avgCnt > 0
639+ <> (if avgCnt > 0
639640 then let lat = avgTime `div` fromIntegral avgCnt
640641 in "\navg worker latency = "
641− ++ secs (fromIntegral lat * 1e-9)
642+ <> secs (fromIntegral lat * 1e-9)
642643 else "")
643− ++ (if svarLat > 0
644+ <> (if svarLat > 0
644645 then "\nSVar latency = "
645− ++ secs (fromIntegral svarLat * 1e-9)
646+ <> secs (fromIntegral svarLat * 1e-9)
646647 else "")
647− ++ (if svarCnt > 0
648− then "\nSVar yield count = " ++ show svarCnt
648+ <> (if svarCnt > 0
649+ then "\nSVar yield count = " <> show svarCnt
649650 else "")
650− ++ (if svarGainLossCnt > 0
651− then "\nSVar gain/loss yield count = " ++ show svarGainLossCnt
651+ <> (if svarGainLossCnt > 0
652+ then "\nSVar gain/loss yield count = " <> show svarGainLossCnt
652653 else "")
653654 ]
654655
@@ -663,10 +664,10 @@ dumpSVar sv = do
663664 (oheap, oheapSeq) <- readIORef $ outputHeap sv
664665 (wq, wqSeq) <- readIORef $ aheadWorkQueue sv
665666 return $ unlines
666− [ "heap length = " ++ show (H.size oheap)
667− , "heap seqeunce = " ++ show oheapSeq
668− , "work queue length = " ++ show (length wq)
669− , "work queue sequence = " ++ show wqSeq
667+ [ "heap length = " <> show (H.size oheap)
668+ , "heap seqeunce = " <> show oheapSeq
669+ , "work queue length = " <> show (length wq)
670+ , "work queue sequence = " <> show wqSeq
670671 ]
671672 else return []
672673
@@ -681,23 +682,23 @@ dumpSVar sv = do
681682
682683 return $ unlines
683684 [
684− "Creator tid = " ++ show (svarCreator sv),
685− "style = " ++ show (svarStyle sv)
685+ "Creator tid = " <> show (svarCreator sv),
686+ "style = " <> show (svarStyle sv)
686687 , "---------CURRENT STATE-----------"
687− , "outputQueue length computed = " ++ show (length oqList)
688− , "outputQueue length maintained = " ++ show oqLen
688+ , "outputQueue length computed = " <> show (length oqList)
689+ , "outputQueue length maintained = " <> show oqLen
689690 -- XXX print the types of events in the outputQueue, first 5
690− , "outputDoorBell = " ++ show db
691+ , "outputDoorBell = " <> show db
691692 ]
692− ++ aheadDump
693− ++ unlines
694− [ "needDoorBell = " ++ show waiting
695− , "running threads = " ++ show rthread
693+ <> aheadDump
694+ <> unlines
695+ [ "needDoorBell = " <> show waiting
696+ , "running threads = " <> show rthread
696697 -- XXX print the status of first 5 threads
697− , "running thread count = " ++ show workers
698+ , "running thread count = " <> show workers
698699 ]
699− ++ "---------STATS-----------\n"
700− ++ stats
700+ <> "---------STATS-----------\n"
701+ <> stats
701702
702703-- MVar diagnostics has some overhead - around 5% on asyncly null benchmark, we
703704-- can keep it on in production to debug problems quickly if and when they
@@ -708,14 +709,14 @@ dumpSVar sv = do
708709mvarExcHandler :: SVar t m a -> String -> BlockedIndefinitelyOnMVar -> IO ()
709710mvarExcHandler sv label e@BlockedIndefinitelyOnMVar = do
710711 svInfo <- dumpSVar sv
711− hPutStrLn stderr $ label ++ " " ++ "BlockedIndefinitelyOnMVar\n" ++ svInfo
712+ hPutStrLn stderr $ label <> " " <> "BlockedIndefinitelyOnMVar\n" <> svInfo
712713 throwIO e
713714
714715{-# NOINLINE stmExcHandler #-}
715716stmExcHandler :: SVar t m a -> String -> BlockedIndefinitelyOnSTM -> IO ()
716717stmExcHandler sv label e@BlockedIndefinitelyOnSTM = do
717718 svInfo <- dumpSVar sv
718− hPutStrLn stderr $ label ++ " " ++ "BlockedIndefinitelyOnSTM\n" ++ svInfo
719+ hPutStrLn stderr $ label <> " " <> "BlockedIndefinitelyOnSTM\n" <> svInfo
719720 throwIO e
720721
721722withDiagMVar :: SVar t m a -> String -> IO () -> IO ()