fixplate-0.1.5: Uniplate-style generic traversals for optionally annotated fixed-point types.Source codeContentsIndex
Data.Generics.Fixplate.Draw
Contents
Default tree drawing, using Show instancess
Customizable tree drawing
Description

Generic ascii art / graphviz drawing of trees.

Suggestions for drawing styles are welcome.

TODO:

  • make the style customizable
  • the same for graphviz
Synopsis
drawTree :: (Functor f, Foldable f, ShowF f) => Mu f -> IO ()
showTree :: (Functor f, Foldable f, ShowF f) => Mu f -> String
graphvizTree :: (Traversable f, ShowF f) => Mu f -> String
drawTreeWith :: (Functor f, Foldable f) => (f Hole -> String) -> Mu f -> IO ()
showTreeWith :: (Functor f, Foldable f) => (f Hole -> String) -> Mu f -> String
graphvizTreeWith :: Traversable f => (f Hole -> String) -> Mu f -> String
Default tree drawing, using Show instancess
drawTree :: (Functor f, Foldable f, ShowF f) => Mu f -> IO ()Source

Prints a tree. It is defined simply as

 drawTree = putStrLn . showTree
showTree :: (Functor f, Foldable f, ShowF f) => Mu f -> StringSource
Creates a string representation which can be printed with putStrLn.
graphvizTree :: (Traversable f, ShowF f) => Mu f -> StringSource
Generate a graphviz .dot file
Customizable tree drawing
drawTreeWith :: (Functor f, Foldable f) => (f Hole -> String) -> Mu f -> IO ()Source
showTreeWith :: (Functor f, Foldable f) => (f Hole -> String) -> Mu f -> StringSource
graphvizTreeWith :: Traversable f => (f Hole -> String) -> Mu f -> StringSource
Produced by Haddock version 2.6.1