Commit 07f6418e authored by niteria's avatar niteria Committed by Austin Seipp

Remove graphFromVerticesAndAdjacency

It's not used anywhere.

Reviewed By: austin

Differential Revision: https://phabricator.haskell.org/D1266
parent d516d2e1
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment