From b2035823daa804d7bc83f4a4b8d51c7ed14da9a0 Mon Sep 17 00:00:00 2001 From: Norman Ramsey Date: Fri, 21 Oct 2022 13:32:13 +0000 Subject: add the two key graph modules from Martin Erwig's FGL Martin Erwig's FGL (Functional Graph Library) provides an "inductive" representation of graphs. A general graph has labeled nodes and labeled edges. The key operation on a graph is to decompose it by removing one node, together with the edges that connect the node to the rest of the graph. There is also an inverse composition operation. The decomposition and composition operations make this representation of graphs exceptionally well suited to implement graph algorithms in which the graph is continually changing, as alluded to in #21259. This commit adds `GHC.Data.Graph.Inductive.Graph`, which defines the interface, and `GHC.Data.Graph.Inductive.PatriciaTree`, which provides an implementation. Both modules are taken from `fgl-5.7.0.3` on Hackage, with these changes: - Copyright and license text have been copied into the files themselves, not stored separately. - Some calls to `error` have been replaced with calls to `panic`. - Conditional-compilation support for older versions of GHC, `containers`, and `base` has been removed. --- compiler/ghc.cabal.in | 2 ++ 1 file changed, 2 insertions(+) (limited to 'compiler/ghc.cabal.in') diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in index d065f4194e..28a472a24e 100644 --- a/compiler/ghc.cabal.in +++ b/compiler/ghc.cabal.in @@ -374,6 +374,8 @@ Library GHC.Data.Graph.Base GHC.Data.Graph.Color GHC.Data.Graph.Directed + GHC.Data.Graph.Inductive.Graph + GHC.Data.Graph.Inductive.PatriciaTree GHC.Data.Graph.Ops GHC.Data.Graph.Ppr GHC.Data.Graph.UnVar -- cgit v1.2.1