Reading dot files with graphviz package in haskell

Viewed 113

For a program i have to reformat a dot file in Haskell to adjust the layout of its tree/content. I decided to use https://hackage.haskell.org/package/graphviz-2999.20.1.0/docs/Data-GraphViz.html , but i cant find simple tutorials and the documentation confuses me, namely:

1 . It contains a function: dotToGraph, which reads: "A pseudo-inverse to graphToDot; "pseudo" in the sense that the original node and edge labels aren't able to be reconstructed."

I do need to retain the names of the nodes and edges, which i suppose are the labels mentioned here? but it seems weird that it cannot do this. It also does not take in a file name or string for the dot text, so i assume this is the wrong function.

2 . There also seems to be a parseDot function/class that comes with the package, but i cant find clear documentation for its use. (see: https://hackage.haskell.org/package/graphviz-2999.20.1.0/docs/Data-GraphViz-Parsing.html#t:ParseDot)

Can you recommend me a simple overview/summary/online example for doing this? Should i be using a different function? I have only recently started using Haskell, so the package documentation is sometimes difficult to decipher for me.

It would help a great deal, thanks!

0 Answers
Related