Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
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 -> String Source #
Creates a string representation which can be printed with putStrLn
.
graphvizTree :: (Traversable f, ShowF f) => Mu f -> String Source #
Generate a graphviz .dot
file
Customizable tree drawing
graphvizTreeWith :: Traversable f => (f Hole -> String) -> Mu f -> String Source #