From 6188d0ab4f5eaa85b5e5c743939b71f95ade688c Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Fri, 6 Mar 2015 13:43:31 -0800 Subject: Refactor Digraph to use Data.Graph when possible Summary: This just rewrites the IntGraph data type. Signed-off-by: Edward Z. Yang Test Plan: validate Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D708 --- compiler/utils/Outputable.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compiler/utils/Outputable.hs') 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))) + {- ************************************************************************ * * -- cgit v1.2.1