graphviz-2999.5.1.0: GraphViz bindings for Haskell.



This module defines simple helper functions for use with Text.PrettyPrint. It also re-exports all the pretty-printing combinators from that module.

Note that the PrintDot instances for Bool, etc. match those specified for use with GraphViz.

You should only be using this module if you are writing custom node types for use with Data.GraphViz.Types. For actual printing of code, use Data.GraphViz.Types.printDotGraph (which produces a String value).

The Dot language specification specifies that any identifier is in one of four forms:

  • Any string of alphabetic ([a-zA-Z200-377]) characters, underscores ('_') or digits ([0-9]), not beginning with a digit;
  • a number [-]?(.[0-9]+ | [0-9]+(.[0-9]*)? );
  • any double-quoted string ("...") possibly containing escaped quotes (");
  • an HTML string (...).

Due to these restrictions, you should only use text when you are sure that the String in question is static and quotes are definitely needed/unneeded; it is better to use the String instance for PrintDot. For more information, see the specification page:



type DotCode = DocSource

A type alias to indicate what is being produced.

renderDot :: DotCode -> StringSource

Correctly render GraphViz output.

class PrintDot a whereSource

A class used to correctly print parts of the GraphViz Dot language. Minimal implementation is unqtDot.


unqtDot :: a -> DotCodeSource

The unquoted representation, for use when composing values to produce a larger printing value.

toDot :: a -> DotCodeSource

The actual quoted representation; this should be quoted if it contains characters not permitted a plain ID String, a number or it is not an HTML string. Defaults to unqtDot.

unqtListToDot :: [a] -> DotCodeSource

The correct way of representing a list of this value when printed; not all Dot values require this to be implemented. Defaults to Haskell-like list representation.

listToDot :: [a] -> DotCodeSource

The quoted form of unqtListToDot; defaults to wrapping double quotes around the result of unqtListToDot (since the default implementation has characters that must be quoted).

commaDel :: (PrintDot a, PrintDot b) => a -> b -> DotCodeSource