HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Moduleghc-lib-parser-9.14.1.20251220GHC2021

GHC.Data.Graph.Directed

  • 4 types
  • 21 values
datadata Graph node
#
Instances1Outputable
datadata SCC vertex
#

Strongly connected component.

Constructors

Instances20Functor, Foldable, Traversable, Foldable1, Eq1, Read1, …
patternpattern CyclicSCC :: [vertex] -> SCC vertex
#

Partial pattern synonym for backward compatibility with containers < 0.7.

datadata Node key payload
#

Representation for nodes of the Graph.

  • The payload is user data, just carried around in this module

  • The key is the node identifier. Key has an Ord instance for performance reasons.

  • The [key] are the dependencies of the node; it's ok to have extra keys in the dependencies that are not the key of any Node in the graph

Constructors

Instances2Functor, Outputable
valueflattenSCC :: SCC vertex -> [vertex]
#

The vertices of a strongly connected component.

flattenSCC = toList . flattenSCC1.

This function is retained for backward compatibility, flattenSCC1 has the more precise type.

valueflattenSCCs :: [SCC a] -> [a]
#

The vertices of a list of strongly connected components.

valuereachablesG :: Graph node -> [node] -> [node]
#

Given a list of roots, return all reachable nodes in topological order. Implemented using a depth-first traversal.

valuefindCycle :: Ord key => [Node key payload] -> Maybe [payload]
#

Find a reasonably short cycle a->b->c->a, in a graph The graph might not necessarily be strongly connected.

datadata EdgeType
#

Edge direction based on DFS Classification

Constructors

Instances3Eq, Ord, Outputable
  • Eq EdgeTypeDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Data.Graph.Directed
  • Ord EdgeTypeDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Data.Graph.Directed
  • Outputable EdgeTypeDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Data.Graph.Directed
valueclassifyEdges
  1. :: Uniquable key
  2. => key
  3. -> key -> [key]
  4. -> [(key, key)]
  5. -> [((key, key), EdgeType)]
#

Given a start vertex, a way to get successors from a node and a list of (directed) edges classify the types of edges.