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-9.14.1GHC2021

GHC.Data.Graph.Directed

  • 4 types
  • 21 values
  • Packageghc-9.14.1
  • Exports26
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceGraph.hs
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
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.