[commit: ghc] master: Add Outputable instance for Node (6e890e8)
git at git.haskell.org
git at git.haskell.org
Thu May 11 21:33:40 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/6e890e8c9b960805c87268e9b3ce2e3d4a58297b/ghc
>---------------------------------------------------------------
commit 6e890e8c9b960805c87268e9b3ce2e3d4a58297b
Author: Matthew Pickering <matthewtpickering at gmail.com>
Date: Thu May 11 15:42:02 2017 -0400
Add Outputable instance for Node
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3564
>---------------------------------------------------------------
6e890e8c9b960805c87268e9b3ce2e3d4a58297b
compiler/utils/Digraph.hs | 3 +++
1 file changed, 3 insertions(+)
diff --git a/compiler/utils/Digraph.hs b/compiler/utils/Digraph.hs
index fe325e6..e3b5037 100644
--- a/compiler/utils/Digraph.hs
+++ b/compiler/utils/Digraph.hs
@@ -99,6 +99,9 @@ data Node key payload = DigraphNode {
-- it's ok to have extra keys in the dependencies that
-- are not the key of any Node in the graph
+instance (Outputable a, Outputable b) => Outputable (Node a b) where
+ ppr (DigraphNode a b c) = ppr (a, b, c)
+
emptyGraph :: Graph a
emptyGraph = Graph (array (1, 0) []) (error "emptyGraph") (const Nothing)
More information about the ghc-commits
mailing list