graph-rewriting-0.5: Monadic graph rewriting of hypergraphs with ports and multiedges



Most of the functions for graph scrutinisation (GraphRewriting.Graph.Read) and modification (GraphRewriting.Graph.Write) are defined monadically. This module defines functions for extracting these monadic values and a few non-monadic graph scrutinisation/modification functions.



nodes :: Graph n -> [n]Source

edges :: Graph n -> [(Edge, [n])]Source

Each edge corresponds to the set of nodes it connects

unsafeMapNodes :: (n -> n') -> Graph n -> Graph n'Source

unsafe, as no check for changed edge references is performed

unsafeMapNodesUnique :: (Int -> n -> n') -> Graph n -> Graph n'Source

unsafe map that supplies an additional unique key to the mapping function

runGraph :: Rewrite n a -> Graph n -> (a, Graph n)Source

apply a monadic graph modification to a graph

evalGraph :: Rewrite n a -> Graph n -> aSource