Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides common boilerplate code which implements constructing a Pangraph from either ASTs or Graph types.
It is exported as internal for now as it is intended use by modules which will not re-export it.
Synopsis
- data ProtoVertex
- data ProtoEdge
- makeProtoVertex :: [Attribute] -> ProtoVertex
- makeProtoEdge :: [Attribute] -> ProtoEdge
- protoVertexAttributes :: ProtoVertex -> [Attribute]
- protoEdgeAttributes :: ProtoEdge -> [Attribute]
- class BuildPangraph t
- buildPangraph :: BuildPangraph t => t -> (ProtoVertex -> VertexID) -> (ProtoEdge -> (VertexID, VertexID)) -> Maybe Pangraph
- getProtoEdge :: BuildPangraph t => t -> [ProtoEdge]
- getProtoVertex :: BuildPangraph t => t -> [ProtoVertex]
Documentation
data ProtoVertex Source #
Instances
Eq ProtoVertex Source # | |
Defined in Pangraph.Internal.ProtoGraph (==) :: ProtoVertex -> ProtoVertex -> Bool # (/=) :: ProtoVertex -> ProtoVertex -> Bool # | |
Show ProtoVertex Source # | |
Defined in Pangraph.Internal.ProtoGraph showsPrec :: Int -> ProtoVertex -> ShowS # show :: ProtoVertex -> String # showList :: [ProtoVertex] -> ShowS # |
makeProtoVertex :: [Attribute] -> ProtoVertex Source #
ProtoVertex constructor
makeProtoEdge :: [Attribute] -> ProtoEdge Source #
ProtoEdge constructor
protoVertexAttributes :: ProtoVertex -> [Attribute] Source #
Returns [Attribute
] of a ProtoVertex
class BuildPangraph t Source #
buildPangraph :: BuildPangraph t => t -> (ProtoVertex -> VertexID) -> (ProtoEdge -> (VertexID, VertexID)) -> Maybe Pangraph Source #
Given an Instance t of the BuildGraph will attempt to construct a Pangraph. This can be used to avoid boilerplate code which is common many implementations.
getProtoEdge :: BuildPangraph t => t -> [ProtoEdge] Source #
getProtoVertex :: BuildPangraph t => t -> [ProtoVertex] Source #