summaryrefslogtreecommitdiff
path: root/compiler/utils/Digraph.hs
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2015-09-21 16:52:10 -0500
committerAustin Seipp <austin@well-typed.com>2015-09-21 16:52:43 -0500
commit07f6418e690bc44b7b24ca3e376494287679e544 (patch)
treeb5c05276df7410446037cb02c9e01b8e66ba7ea0 /compiler/utils/Digraph.hs
parentd516d2e1a4ca349b4a0ad0ed2e71e8ea8808c1d7 (diff)
downloadhaskell-07f6418e690bc44b7b24ca3e376494287679e544.tar.gz
Remove graphFromVerticesAndAdjacency
It's not used anywhere. Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D1266
Diffstat (limited to 'compiler/utils/Digraph.hs')
-rw-r--r--compiler/utils/Digraph.hs20
1 files changed, 1 insertions, 19 deletions
diff --git a/compiler/utils/Digraph.hs b/compiler/utils/Digraph.hs
index 3f6ee29443..d5924a95e2 100644
--- a/compiler/utils/Digraph.hs
+++ b/compiler/utils/Digraph.hs
@@ -4,7 +4,7 @@
-- For Functor SCC. ToDo: Remove me when 7.10 is released
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Digraph(
- Graph, graphFromVerticesAndAdjacency, graphFromEdgedVertices,
+ Graph, graphFromEdgedVertices,
SCC(..), Node, flattenSCC, flattenSCCs,
stronglyConnCompG,
@@ -96,24 +96,6 @@ type Node key payload = (payload, key, [key])
emptyGraph :: Graph a
emptyGraph = Graph (array (1, 0) []) (error "emptyGraph") (const Nothing)
-graphFromVerticesAndAdjacency
- :: Ord key
- => [(node, key)]
- -> [(key, key)] -- First component is source vertex key,
- -- second is target vertex key (thing depended on)
- -- Unlike the other interface I insist they correspond to
- -- actual vertices because the alternative hides bugs. I can't
- -- do the same thing for the other one for backcompat reasons.
- -> Graph (node, key)
-graphFromVerticesAndAdjacency [] _ = emptyGraph
-graphFromVerticesAndAdjacency vertices edges = Graph graph vertex_node (key_vertex . key_extractor)
- where key_extractor = snd
- (bounds, vertex_node, key_vertex, _) = reduceNodesIntoVertices vertices key_extractor
- key_vertex_pair (a, b) = (expectJust "graphFromVerticesAndAdjacency" $ key_vertex a,
- expectJust "graphFromVerticesAndAdjacency" $ key_vertex b)
- reduced_edges = map key_vertex_pair edges
- graph = buildG bounds reduced_edges
-
graphFromEdgedVertices
:: Ord key
=> [Node key payload] -- The graph; its ok for the