diff options
| author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2015-03-06 13:43:31 -0800 |
|---|---|---|
| committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2015-03-09 11:55:55 -0700 |
| commit | c439af5f5baa2c8af3434652554135230edbf5c3 (patch) | |
| tree | c72721e8bc51588367b2bb039bcd59aed2de5421 /compiler/utils/Outputable.hs | |
| parent | 2aef3205115b88be8c068739c136eadc8c07e886 (diff) | |
| download | haskell-c439af5f5baa2c8af3434652554135230edbf5c3.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.hs | 5 |
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))) + {- ************************************************************************ * * |
