Safe Haskell | None |
---|---|
Language | Haskell2010 |
SimpleGraph is, as the name implies, a simple implementation of the Graph interface. For example, we don't bother to sort the arcs going out of a node, meaning that to find out if two nodes are connected requires searching all the arcs out of one of the nodes, or all the arcs into the other.
Notes on synchronicity. The Update operations Set*Label are intrinsically unsafe in this implementation since if two communicating SimpleGraphs both execute a Set*Label operation with different label values they may end up with each others values. It is recommended that Set*Label only be used during the initialisation of the object, as a way of tieing the knot.
In addition, Update operations which create a value based on a previous value (EG a NewNode creates a Node based on a NodeType), do assume that the previous value has already been created.
I realise this is somewhat informal. It may be necessary to replace SimpleGraph by something more complicated later . . .
Documentation
data SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel Source #
Instances
Graph SimpleGraph Source # | |
Defined in Graphs.SimpleGraph getNodes :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> IO [Node] Source # getArcs :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> IO [Arc] Source # getNodeTypes :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> IO [NodeType] Source # getArcTypes :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> IO [ArcType] Source # getArcsOut :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Node -> IO [Arc] Source # getArcsIn :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Node -> IO [Arc] Source # getNodeLabel :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Node -> IO nodeLabel Source # getNodeType :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Node -> IO NodeType Source # getNodeTypeLabel :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> NodeType -> IO nodeTypeLabel Source # getSource :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Arc -> IO Node Source # getTarget :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Arc -> IO Node Source # getArcLabel :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Arc -> IO arcLabel Source # getArcType :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Arc -> IO ArcType Source # getArcTypeLabel :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> ArcType -> IO arcTypeLabel Source # shareGraph :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> GraphConnection nodeLabel nodeTypeLabel arcLabel arcTypeLabel Source # newGraph :: GraphConnection nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> IO (SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel) Source # newNodeType :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> nodeTypeLabel -> IO NodeType Source # newNode :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> NodeType -> nodeLabel -> IO Node Source # newArcType :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> arcTypeLabel -> IO ArcType Source # newArc :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> ArcType -> arcLabel -> Node -> Node -> IO Arc Source # update :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Update nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> IO () Source # newEmptyGraph :: IO (SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel) Source # | |
Destroyable (SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel) Source # | |
Defined in Graphs.SimpleGraph destroy :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> IO () # | |
Synchronized (SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel) Source # | |
Defined in Graphs.SimpleGraph synchronize :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> IO b -> IO b # | |
Object (SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel) Source # | |
Defined in Graphs.SimpleGraph objectID :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> ObjectID # |
getNameSource :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> NameSource Source #
delayedAction :: SimpleGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Node -> IO () -> IO () Source #
data ClientData nodeLabel nodeTypeLabel arcLabel arcTypeLabel Source #
ClientData | |
|
Instances
Eq (ClientData nodeLabel nodeTypeLabel arcLabel arcTypeLabel) Source # | |
Defined in Graphs.SimpleGraph (==) :: ClientData nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> ClientData nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Bool # (/=) :: ClientData nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> ClientData nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Bool # |