|
Data.Graph.Inductive.NodeMap |
|
|
|
|
Description |
Utility methods to automatically generate and keep track of a mapping
between node labels and Nodes.
|
|
Synopsis |
|
data NodeMap a | | new :: Ord a => NodeMap a | | fromGraph :: (Ord a, Graph g) => g a b -> NodeMap a | | mkNode :: Ord a => NodeMap a -> a -> (LNode a, NodeMap a) | | mkNode_ :: Ord a => NodeMap a -> a -> LNode a | | mkNodes :: Ord a => NodeMap a -> [a] -> ([LNode a], NodeMap a) | | mkNodes_ :: Ord a => NodeMap a -> [a] -> [LNode a] | | mkEdge :: Ord a => NodeMap a -> (a, a, b) -> Maybe (LEdge b) | | mkEdges :: Ord a => NodeMap a -> [(a, a, b)] -> Maybe [LEdge b] | | insMapNode :: (Ord a, DynGraph g) => NodeMap a -> a -> g a b -> (g a b, NodeMap a, LNode a) | | insMapNode_ :: (Ord a, DynGraph g) => NodeMap a -> a -> g a b -> g a b | | insMapEdge :: (Ord a, DynGraph g) => NodeMap a -> (a, a, b) -> g a b -> g a b | | delMapNode :: (Ord a, DynGraph g) => NodeMap a -> a -> g a b -> g a b | | delMapEdge :: (Ord a, DynGraph g) => NodeMap a -> (a, a) -> g a b -> g a b | | insMapNodes :: (Ord a, DynGraph g) => NodeMap a -> [a] -> g a b -> (g a b, NodeMap a, [LNode a]) | | insMapNodes_ :: (Ord a, DynGraph g) => NodeMap a -> [a] -> g a b -> g a b | | insMapEdges :: (Ord a, DynGraph g) => NodeMap a -> [(a, a, b)] -> g a b -> g a b | | delMapNodes :: (Ord a, DynGraph g) => NodeMap a -> [a] -> g a b -> g a b | | delMapEdges :: (Ord a, DynGraph g) => NodeMap a -> [(a, a)] -> g a b -> g a b | | mkMapGraph :: (Ord a, DynGraph g) => [a] -> [(a, a, b)] -> (g a b, NodeMap a) | | type NodeMapM a b g r = State (NodeMap a, g a b) r | | run :: (DynGraph g, Ord a) => g a b -> NodeMapM a b g r -> (r, (NodeMap a, g a b)) | | run_ :: (DynGraph g, Ord a) => g a b -> NodeMapM a b g r -> g a b | | mkNodeM :: (Ord a, DynGraph g) => a -> NodeMapM a b g (LNode a) | | mkNodesM :: (Ord a, DynGraph g) => [a] -> NodeMapM a b g [LNode a] | | mkEdgeM :: (Ord a, DynGraph g) => (a, a, b) -> NodeMapM a b g (Maybe (LEdge b)) | | mkEdgesM :: (Ord a, DynGraph g) => [(a, a, b)] -> NodeMapM a b g (Maybe [LEdge b]) | | insMapNodeM :: (Ord a, DynGraph g) => a -> NodeMapM a b g (LNode a) | | insMapEdgeM :: (Ord a, DynGraph g) => (a, a, b) -> NodeMapM a b g () | | delMapNodeM :: (Ord a, DynGraph g) => a -> NodeMapM a b g () | | delMapEdgeM :: (Ord a, DynGraph g) => (a, a) -> NodeMapM a b g () | | insMapNodesM :: (Ord a, DynGraph g) => [a] -> NodeMapM a b g [LNode a] | | insMapEdgesM :: (Ord a, DynGraph g) => [(a, a, b)] -> NodeMapM a b g () | | delMapNodesM :: (Ord a, DynGraph g) => [a] -> NodeMapM a b g () | | delMapEdgesM :: (Ord a, DynGraph g) => [(a, a)] -> NodeMapM a b g () |
|
|
|
Functional Construction
|
|
|
Instances | |
|
|
Map Construction
|
|
|
Create a new, empty mapping.
|
|
|
Generate a mapping containing the nodes in the given graph.
|
|
|
Generate a labelled node from the given label. Will return the same node
for the same label.
|
|
|
Generate a labelled node and throw away the modified NodeMap.
|
|
|
Construct a list of nodes.
|
|
|
Construct a list of nodes and throw away the modified NodeMap.
|
|
|
Generate a LEdge from the node labels.
|
|
|
Generates a list of LEdges.
|
|
Graph Construction
|
|
These functions mirror the construction and destruction functions in
Graph, but use the given NodeMap to look up
the appropriate Nodes. Note that the insMapNode family of functions
will create new nodes as needed, but the other functions will not.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Monadic Construction
|
|
|
Graph construction monad; handles passing both the NodeMap and the
Graph.
|
|
The following mirror the functional construction functions, but handle passing
NodeMaps and Graphs behind the scenes.
|
|
Map Construction
|
|
|
Run a construction; return the value of the computation, the modified
NodeMap, and the modified Graph.
|
|
|
Run a construction and only return the Graph.
|
|
|
Monadic node construction.
|
|
|
|
|
|
|
|
Graph Construction
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Produced by Haddock version 0.9 |