summaryrefslogtreecommitdiff
path: root/compiler/utils
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2017-05-11 15:42:02 -0400
committerBen Gamari <ben@smart-cactus.org>2017-05-11 17:33:11 -0400
commit6e890e8c9b960805c87268e9b3ce2e3d4a58297b (patch)
tree3648301111a9692ea53716dbc25678fbb2b19159 /compiler/utils
parentaa8dcb33fd26d8bfd4cac2fbd1b1785b4a869897 (diff)
downloadhaskell-6e890e8c9b960805c87268e9b3ce2e3d4a58297b.tar.gz
Add Outputable instance for Node
Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3564
Diffstat (limited to 'compiler/utils')
-rw-r--r--compiler/utils/Digraph.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/utils/Digraph.hs b/compiler/utils/Digraph.hs
index fe325e6a06..e3b5037bf3 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)