dataflow: Generate Graphviz documents from a Haskell representation.

[ bsd3, code-generation, compiler, graphs, library, program ] [ Propose Tags ]

Outputs .dot files that can be processed by the dot command. Currently it only supports the DFD output format (http:/en.wikipedia.orgwiki/Data_flow_diagram). Support for a Graphviz-like input format (instead of using the data structures in Haskell) is planned.

[Skip to Readme]
Versions [faq],,,,,,,,,,,,,,,,,
Dependencies base (>=4 && <4.8), containers (>=0.4), mtl (>=2.2) [details]
License MIT
Author Oskar Wickström
Category Code Generation, Compiler, Graphs
Home page
Source repo head: git clone
Uploaded by owickstrom at 2015-04-14T04:37:45Z
Distributions NixOS:
Downloads 9876 total (9 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs not available [build log]
All reported builds failed as of 2016-12-10 [all 8 reports]


  • DataFlow
    • DataFlow.Core
    • DataFlow.DFD
    • DataFlow.Graphviz
      • DataFlow.Graphviz.EdgeNormalization
      • DataFlow.Graphviz.Renderer


Maintainer's Corner

For package maintainers and hackage trustees

Readme for dataflow-

[back to package description]


Generate Graphviz documents from a Haskell representation.

Getting Started

cabal sandbox init
cabal configure --enable-tests
cabal install --only-dependencies --enable-tests



The objects supported by DataFlow is:

  • TrustBoundary
  • InputOutput
  • Function
  • Database
  • Flow

These are composed in a Diagram to get something printable.

For more on Haskell data types, see the Hackage site.


module Main where

import DataFlow.Core
import DataFlow.Graphviz.Renderer
import DataFlow.DFD

main :: IO ()
main = putStr $ renderGraphviz $ asDFD  $
  Diagram (Just "Webapp") [
    TrustBoundary "browser" "Browser" [
      Function "client" "Client"
    TrustBoundary "aws" "Amazon AWS" [
      Function "server" "Web Server",
      Database "logs" "Logs"
    InputOutput "analytics" "Google Analytics",

    Flow "client" "server" "Request /" "",
    Flow "server" "logs" "Log" "User IP",
    Flow "server" "client" "Response" "User Profile",

    Flow "client" "analytics" "Log" "Page Navigation"

Then generate your output with dot.

runhaskell example.hs | dot -Tsvg > example.svg

That should generate something like the following.

Example Output

Building the Examples

make -C examples


cabal clean && cabal build && cabal sdist && cabal upload dist/dataflow-*.tar.gz