As discussed in #29 (Support for GML) a change to Text is needed and using a Value Sum type will useful for working with many kinds of data.
type Attribute = [(Text, Value)]
data Value = Integer Integer | Double Double | Boolean Boolean | Text Text
The Pangraph type could be changed:
data Pangraph v e = Pangraph [(Int, v)] [(Int, e)] deriving (Eq)
-- With the 'Value' as before
type ValueGraph = Pangraph Value Value
How will current default implementations work?
-
GraphML has fields for keys with values such as n1 where it is nearly a num. Perhaps users can provide a function to return an Int type for their file or if they are not concerned just use Text?
-
In the patch (still to be pushed to my fork) preceding this there is a ProtoGraph type which has functions implementing boilerplate code currently required to construct a Graph. A pair of functions completeGraph :: Protograph -> (ProtoVertex -> VertexID) -> (ProtoEdge -> (VertexID, VertexID)) -> Maybe Pangraph and completeGraphWithDefault :: Protograph -> Maybe Pangraph. This could be changed in 0.3.0 to include the value types and return a ValueGraph
As discussed in #29 (Support for GML) a change to Text is needed and using a Value Sum type will useful for working with many kinds of data.
The Pangraph type could be changed:
How will current default implementations work?
GraphML has fields for keys with values such as
n1where it is nearly a num. Perhaps users can provide a function to return an Int type for their file or if they are not concerned just use Text?In the patch (still to be pushed to my fork) preceding this there is a
ProtoGraphtype which has functions implementing boilerplate code currently required to construct a Graph. A pair of functionscompleteGraph :: Protograph -> (ProtoVertex -> VertexID) -> (ProtoEdge -> (VertexID, VertexID)) -> Maybe PangraphandcompleteGraphWithDefault :: Protograph -> Maybe Pangraph. This could be changed in 0.3.0 to include the value types and return aValueGraph