summaryrefslogtreecommitdiff
path: root/compiler/utils/Outputable.hs
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2015-03-06 13:43:31 -0800
committerEdward Z. Yang <ezyang@cs.stanford.edu>2015-03-09 14:21:45 -0700
commit6188d0ab4f5eaa85b5e5c743939b71f95ade688c (patch)
treee6ddc94e4389a207fca482621744e8217b7118b6 /compiler/utils/Outputable.hs
parentfe3cf4d277b55f99feb9e143705d414f8ca7133b (diff)
downloadhaskell-6188d0ab4f5eaa85b5e5c743939b71f95ade688c.tar.gz
Refactor Digraph to use Data.Graph when possible
Summary: This just rewrites the IntGraph data type. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D708
Diffstat (limited to 'compiler/utils/Outputable.hs')
-rw-r--r--compiler/utils/Outputable.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/utils/Outputable.hs b/compiler/utils/Outputable.hs
index 6c7ae08379..c557224fc1 100644
--- a/compiler/utils/Outputable.hs
+++ b/compiler/utils/Outputable.hs
@@ -105,6 +105,7 @@ import Data.Word
import System.IO ( Handle )
import System.FilePath
import Text.Printf
+import Data.Graph (SCC(..))
import GHC.Fingerprint
import GHC.Show ( showMultiLineString )
@@ -769,6 +770,10 @@ instance (Outputable elt) => Outputable (IM.IntMap elt) where
instance Outputable Fingerprint where
ppr (Fingerprint w1 w2) = text (printf "%016x%016x" w1 w2)
+instance Outputable a => Outputable (SCC a) where
+ ppr (AcyclicSCC v) = text "NONREC" $$ (nest 3 (ppr v))
+ ppr (CyclicSCC vs) = text "REC" $$ (nest 3 (vcat (map ppr vs)))
+
{-
************************************************************************
* *