HORIZON HASKELLDocslts/ghc-10.0.x04404a62026-10-19Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 04404a6 · 2026-10-19

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
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-10.0.0.20260917 · GHC.Data.Graph.Directed
  • Ord EdgeTypeDefined in ghc-10.0.0.20260917 · GHC.Data.Graph.Directed
  • Outputable EdgeTypeDefined in ghc-10.0.0.20260917 · 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.