This question does not solve the problem that I'm facing, but my question is based on it.
What I'm trying to achieve is to plot a directed graph with labelled nodes and unlabelled edges using graphviz package. In my case nodes have labels of type String (the type definition of the graph is Gr String ()). Here's the code (where used graph is a minified version of clr486 - a perfect example of my use case):
module Main where
import Data.Graph.Inductive.Graph (mkGraph)
import Data.Graph.Inductive.PatriciaTree (Gr)
import Data.GraphViz (graphToDot, nonClusteredParams)
import Data.GraphViz.Printing (renderDot, toDot)
import Data.Text.Lazy (unpack)
main :: IO ()
main = do
let exampleGraph = mkGraph (zip [1..3] ["shorts", "socks", "watch"]) [(1,2,()),(2,3,())] :: Gr String ()
putStrLn $ unpack $ renderDot $ toDot $ graphToDot nonClusteredParams exampleGraph
It looks like the "labels" in context of graphviz haskell package don't mean what I'd assume are the actual labels of the graph - the resulting graph's labels turn out to be its "internal" indices. The output of this code is:
digraph {
1;
2;
3;
1 -> 2;
2 -> 3;
}
And when passed to dot resulting graph looks like this:
But what I'd like to achieve is the following:

