Skip to content

Change to ByteString to Text and move it into a Value sum type also discuss how to Parameterize the Pangraph type #32

Description

@thisiswhereitype

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions