HORIZON HASKELLDocslts/ghc-9.14.x7a6c33e2026-10-12Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 7a6c33e · 2026-10-12

Modulegraphviz-2999.20.2.1Haskell2010

Data.GraphViz.Commands.IO

Various utility functions to help with custom I/O of Dot code.

Contents
  1. Encoding
  2. Operations on files
  3. Operations on handles
  4. Special cases for standard input and output
  5. Running external commands
Synopsis

Encoding

By default, Dot code should be in UTF-8. However, by usage of the charset attribute, users are able to specify that the ISO-8859-1 (aka Latin1) encoding should be used instead: http://www.graphviz.org/doc/info/attrs.html#d:charset

To simplify matters, graphviz does not work with ISO-8859-1. If you wish to deal with existing Dot code that uses this encoding, you will need to manually read that file in to a Text value.

If a non-UTF-8 encoding is used, then a GraphvizException will be thrown.

Operations on files

Operations on handles

Special cases for standard input and output

Running external commands

valuerunCommand
  1. :: PrintDotRepr dg n
  2. => String

    Command to run

  3. -> [String]

    Command-line arguments

  4. -> (Handle -> IO a)

    Obtaining the output; should be strict.

  5. -> dg n
  6. -> IO a

Run an external command on the specified DotRepr. Remember to use hSetBinaryMode on the Handle for the output function if necessary.

If the command was unsuccessful, then a GraphvizException is thrown.

For performance reasons, a temporary file is used to store the generated Dot code. As such, this is only suitable for local commands.