uni-graphs-2.2.0.0: Graphs

Graphs.Graph

Description

Graph defines the Graph class, which defines the basic things a graph must do. Peculiarities: (1) Graphs are directed with labelled nodes and arcs. These nodes and arcs have types. (2) The nodes and arcs are identified by values of type Node and Arc. These values are essentially strings. The strings are provided by the user; there is no mechanism for generating new unique strings. (This is because this is easy in the applications I have in mind.) (3) A necessary feature of these graphs is that it is supposed to be easy generate copies, both on the same system and on others.

Documentation

class Graph graph whereSource

Methods

getNodes :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> IO [Node]Source

getArcs :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> IO [Arc]Source

getNodeTypes :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> IO [NodeType]Source

getArcTypes :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> IO [ArcType]Source

getArcsOut :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Node -> IO [Arc]Source

getArcsIn :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Node -> IO [Arc]Source

getNodeLabel :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Node -> IO nodeLabelSource

getNodeType :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Node -> IO NodeTypeSource

getNodeTypeLabel :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> NodeType -> IO nodeTypeLabelSource

getSource :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Arc -> IO NodeSource

getTarget :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Arc -> IO NodeSource

getArcLabel :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Arc -> IO arcLabelSource

getArcType :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Arc -> IO ArcTypeSource

getArcTypeLabel :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> ArcType -> IO arcTypeLabelSource

shareGraph :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> GraphConnection nodeLabel nodeTypeLabel arcLabel arcTypeLabelSource

newGraph :: GraphConnection nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> IO (graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel)Source

newNodeType :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> nodeTypeLabel -> IO NodeTypeSource

newNode :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> NodeType -> nodeLabel -> IO NodeSource

newArcType :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> arcTypeLabel -> IO ArcTypeSource

newArc :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> ArcType -> arcLabel -> Node -> Node -> IO ArcSource

update :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Update nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> IO ()Source

newEmptyGraph :: IO (graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel)Source

Instances

data Update nodeLabel nodeTypeLabel arcLabel arcTypeLabel Source

Constructors

NewNodeType NodeType nodeTypeLabel 
SetNodeTypeLabel NodeType nodeTypeLabel 
NewNode Node NodeType nodeLabel 
DeleteNode Node 
SetNodeLabel Node nodeLabel 
SetNodeType Node NodeType 
NewArcType ArcType arcTypeLabel 
SetArcTypeLabel ArcType arcTypeLabel 
NewArc Arc ArcType arcLabel Node Node 
DeleteArc Arc 
SetArcLabel Arc arcLabel 
SetArcType Arc ArcType 
MultiUpdate [Update nodeLabel nodeTypeLabel arcLabel arcTypeLabel] 

Instances

Show (PartialShow (Update nodeLabel nodeTypeLabel arcLabel arcTypeLabel)) 
(Read nodeLabel, Read nodeTypeLabel, Read arcLabel, Read arcTypeLabel) => Read (Update nodeLabel nodeTypeLabel arcLabel arcTypeLabel) 
(Show nodeLabel, Show nodeTypeLabel, Show arcLabel, Show arcTypeLabel) => Show (Update nodeLabel nodeTypeLabel arcLabel arcTypeLabel) 

data CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel Source

Constructors

CannedGraph 

Fields

updates :: [Update nodeLabel nodeTypeLabel arcLabel arcTypeLabel]
 

Instances

Show (PartialShow (CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel)) 
(Read nodeLabel, Read nodeTypeLabel, Read arcLabel, Read arcTypeLabel) => Read (CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel) 
(Show nodeLabel, Show nodeTypeLabel, Show arcLabel, Show arcTypeLabel) => Show (CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel) 

type GraphConnection nodeLabel nodeTypeLabel arcLabel arcTypeLabel = (Update nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> IO ()) -> IO (GraphConnectionData nodeLabel nodeTypeLabel arcLabel arcTypeLabel)Source

data GraphConnectionData nodeLabel nodeTypeLabel arcLabel arcTypeLabel Source

Constructors

GraphConnectionData 

Fields

graphState :: CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel
 
deRegister :: IO ()
 
graphUpdate :: Update nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> IO ()
 
nameSourceBranch :: NameSourceBranch
 

newtype PartialShow a Source

Constructors

PartialShow a 

Instances

Show (PartialShow a) => Show (PartialShow [a]) 
Show (PartialShow (CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel)) 
Show (PartialShow (Update nodeLabel nodeTypeLabel arcLabel arcTypeLabel)) 
Show (PartialShow (NodeData nodeInfo arcInfo)) 
Show (PartialShow (PureGraph nodeInfo arcInfo))