th-typegraph-0.14: Graph of the subtype relation

Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Haskell.TH.TypeGraph.Graph

Description

Abstract operations on Maps containing graph edges.

Synopsis

Documentation

type GraphEdges v = Map v (Set v) Source

cutVertex :: (Eq a, Ord a) => a -> GraphEdges a -> GraphEdges a Source

Remove a node and all its in- and out-edges.

cutVertices :: (Eq a, Ord a) => (a -> Bool) -> GraphEdges a -> GraphEdges a Source

Cut vertices for which the predicate returns False

cutVerticesM :: (Monad m, Eq a, Ord a) => (a -> m Bool) -> GraphEdges a -> m (GraphEdges a) Source

Cut vertices for which the predicate returns False

mergeVertex :: (Eq a, Ord a) => a -> GraphEdges a -> GraphEdges a Source

Merge a node into the nodes that are its in-edges.

mergeVertices :: (Eq a, Ord a) => (a -> Bool) -> GraphEdges a -> GraphEdges a Source

mergeVerticesM :: (Monad m, Ord a) => (a -> m Bool) -> GraphEdges a -> m (GraphEdges a) Source

partitionM :: forall m a. Monad m => (a -> m Bool) -> [a] -> m ([a], [a]) Source

flatten :: Ord a => Set (Set a) -> Set a Source

graphFromMap :: forall node key a. (Ord a, node ~ a, key ~ a) => GraphEdges a -> (Graph, Vertex -> (node, key, [key]), key -> Maybe Vertex) Source

Build a graph from the result of typeGraphEdges, each edge goes from a type to one of the types it contains. Thus, each edge represents a primitive lens, and each path in the graph is a composition of lenses.