Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 where Source #
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 nodeLabel Source #
getNodeType :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Node -> IO NodeType Source #
getNodeTypeLabel :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> NodeType -> IO nodeTypeLabel Source #
getSource :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Arc -> IO Node Source #
getTarget :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Arc -> IO Node Source #
getArcLabel :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Arc -> IO arcLabel Source #
getArcType :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Arc -> IO ArcType Source #
getArcTypeLabel :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> ArcType -> IO arcTypeLabel Source #
shareGraph :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> GraphConnection nodeLabel nodeTypeLabel arcLabel arcTypeLabel Source #
newGraph :: GraphConnection nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> IO (graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel) Source #
newNodeType :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> nodeTypeLabel -> IO NodeType Source #
newNode :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> NodeType -> nodeLabel -> IO Node Source #
newArcType :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> arcTypeLabel -> IO ArcType Source #
newArc :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> ArcType -> arcLabel -> Node -> Node -> IO Arc Source #
update :: graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> Update nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> IO () Source #
newEmptyGraph :: IO (graph nodeLabel nodeTypeLabel arcLabel arcTypeLabel) Source #
Instances
Graph SimpleGraph Source # | |
Defined in Graphs.SimpleGraph Methods 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 # |
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)) Source # | |
Defined in Graphs.Graph | |
(Read nodeTypeLabel, Read nodeLabel, Read arcTypeLabel, Read arcLabel) => Read (Update nodeLabel nodeTypeLabel arcLabel arcTypeLabel) Source # | |
Defined in Graphs.Graph Methods readsPrec :: Int -> ReadS (Update nodeLabel nodeTypeLabel arcLabel arcTypeLabel) # readList :: ReadS [Update nodeLabel nodeTypeLabel arcLabel arcTypeLabel] # readPrec :: ReadPrec (Update nodeLabel nodeTypeLabel arcLabel arcTypeLabel) # readListPrec :: ReadPrec [Update nodeLabel nodeTypeLabel arcLabel arcTypeLabel] # | |
(Show nodeTypeLabel, Show nodeLabel, Show arcTypeLabel, Show arcLabel) => Show (Update nodeLabel nodeTypeLabel arcLabel arcTypeLabel) Source # | |
data CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel Source #
Constructors
CannedGraph | |
Instances
Show (PartialShow (CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel)) Source # | |
Defined in Graphs.Graph Methods showsPrec :: Int -> PartialShow (CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel) -> ShowS # show :: PartialShow (CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel) -> String # showList :: [PartialShow (CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel)] -> ShowS # | |
(Read nodeTypeLabel, Read nodeLabel, Read arcTypeLabel, Read arcLabel) => Read (CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel) Source # | |
Defined in Graphs.Graph Methods readsPrec :: Int -> ReadS (CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel) # readList :: ReadS [CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel] # readPrec :: ReadPrec (CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel) # readListPrec :: ReadPrec [CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel] # | |
(Show nodeTypeLabel, Show nodeLabel, Show arcTypeLabel, Show arcLabel) => Show (CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel) Source # | |
Defined in Graphs.Graph Methods showsPrec :: Int -> CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> ShowS # show :: CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel -> String # showList :: [CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel] -> ShowS # |
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
|
newtype PartialShow a Source #
Constructors
PartialShow a |
Instances
Show (PartialShow a) => Show (PartialShow [a]) Source # | |
Defined in Graphs.Graph Methods showsPrec :: Int -> PartialShow [a] -> ShowS # show :: PartialShow [a] -> String # showList :: [PartialShow [a]] -> ShowS # | |
Show (PartialShow (CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel)) Source # | |
Defined in Graphs.Graph Methods showsPrec :: Int -> PartialShow (CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel) -> ShowS # show :: PartialShow (CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel) -> String # showList :: [PartialShow (CannedGraph nodeLabel nodeTypeLabel arcLabel arcTypeLabel)] -> ShowS # | |
Show (PartialShow (Update nodeLabel nodeTypeLabel arcLabel arcTypeLabel)) Source # | |
Defined in Graphs.Graph | |
Show (PartialShow (NodeData nodeInfo arcInfo)) Source # | |
Defined in Graphs.PureGraph | |
Show (PartialShow (PureGraph nodeInfo arcInfo)) Source # | |
Defined in Graphs.PureGraph |