th-typegraph-0.17: Graph of the subtype relation

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.TH.TypeGraph.Graph

Description

Abstract operations on Maps containing graph edges.

Synopsis

Documentation

type GraphEdges label key = Map key (label, Set key) Source

graphFromMap :: forall label key. Ord key => GraphEdges label key -> (Graph, Vertex -> (label, 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.

cut :: (Eq a, Ord a) => Set a -> GraphEdges label a -> GraphEdges label a Source

Isolate and remove some nodes

cutM :: (Functor m, Monad m, Eq a, Ord a) => (a -> m Bool) -> GraphEdges label a -> m (GraphEdges label a) Source

Monadic predicate version of cut.

isolate :: (Eq a, Ord a) => Set a -> GraphEdges label a -> GraphEdges label a Source

Remove all the in- and out-edges of some nodes

isolateM :: (Functor m, Monad m, Eq a, Ord a) => (a -> m Bool) -> GraphEdges label a -> m (GraphEdges label a) Source

Monadic predicate version of isolate.

dissolve :: (Eq a, Ord a) => Set a -> GraphEdges label a -> GraphEdges label a Source

Remove some nodes and extend each of their in-edges to each of their out-edges

dissolveM :: (Functor m, Monad m, Eq a, Ord a) => (a -> m Bool) -> GraphEdges label a -> m (GraphEdges label a) Source

Monadic predicate version of dissolve.