HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulefgl-5.8.2.0Haskell98

Data.Graph.Inductive.NodeMap

Utility methods to automatically generate and keep track of a mapping between node labels and Nodes.

  • 2 types
  • 33 values
  • Packagefgl-5.8.2.0
  • Exports35
  • LanguageHaskell98
  • LicenceBSD-3-Clause
  • SourceNodeMap.hs

Functional Construction

1 declaration
datadata NodeMap a
#
Instances4Eq, Read, Show, NFData
  • Eq a => Eq (NodeMap a)Defined in fgl-5.8.2.0 · Data.Graph.Inductive.NodeMap
  • (Ord a, Read a) => Read (NodeMap a)Defined in fgl-5.8.2.0 · Data.Graph.Inductive.NodeMap
  • Show a => Show (NodeMap a)Defined in fgl-5.8.2.0 · Data.Graph.Inductive.NodeMap
  • NFData a => NFData (NodeMap a)Defined in fgl-5.8.2.0 · Data.Graph.Inductive.NodeMap

Map Construction

valuenew :: NodeMap a
#

Create a new, empty mapping.

valuemkNode :: Ord a => NodeMap a -> a -> (LNode a, NodeMap a)
#

Generate a labelled node from the given label. Will return the same node for the same label.

Graph Construction

These functions mirror the construction and destruction functions in Data.Graph.Inductive.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.

valueinsMapEdge
  1. :: (Ord a, DynGraph g)
  2. => NodeMap a
  3. -> (a, a, b)
  4. -> g a b
  5. -> g a b
#

Partial function: raises exception if passed nodes that are not in the graph.

valuedelMapEdge :: (Ord a, DynGraph g) => NodeMap a -> (a, a) -> g a b -> g a b
#

Partial function: raises exception if passed nodes that are not in the graph.

valueinsMapEdges
  1. :: (Ord a, DynGraph g)
  2. => NodeMap a
  3. -> [(a, a, b)]
  4. -> g a b
  5. -> g a b
#

Partial function: raises exception if passed nodes that are not in the graph.

valuedelMapEdges
  1. :: (Ord a, DynGraph g)
  2. => NodeMap a
  3. -> [(a, a)]
  4. -> g a b
  5. -> g a b
#

Partial function: raises exception if passed nodes that are not in the graph.

valuemkMapGraph
  1. :: (Ord a, DynGraph g)
  2. => [a]
  3. -> [(a, a, b)]
  4. -> (g a b, NodeMap a)
#

Partial function: raises exception if passed a node that is not in the graph.

Monadic Construction

1 declaration

The following mirror the functional construction functions, but handle passing NodeMaps and Graphs behind the scenes.

Map Construction

Graph Construction