
tree-view is a package for rendering trees as foldable HTML and Unicode art. http://hackage.haskell.org/package/tree-view Example: *Data.Tree.View> drawTree $ Node "Add" [Node "Sub" [Node "3" [], Node "Mul" [Node "1" [], Node "2" []]], Node "4" []] Add ├╴Sub │ ├╴3 │ └╴Mul │ ├╴1 │ └╴2 └╴4 / Emil

On 13/01/14 11:20, Emil Axelsson wrote:
tree-view is a package for rendering trees as foldable HTML and Unicode art.
http://hackage.haskell.org/package/tree-view
Example:
*Data.Tree.View> drawTree $ Node "Add" [Node "Sub" [Node "3" [], Node "Mul" [Node "1" [], Node "2" []]], Node "4" []] Add ├╴Sub │ ├╴3 │ └╴Mul │ ├╴1 │ └╴2 └╴4
/ Emil _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Hi, What does tree-view offer over pretty-tree[1]? [1]: http://hackage.haskell.org/package/pretty-tree -- Mateusz K.

On 13/01/14 11:24, Mateusz Kowalczyk wrote:
Hi,
What does tree-view offer over pretty-tree[1]?
Sorry, I didn't read that properly. It'd be nice if we could get the result of htmlTree without having to write it out to the file. -- Mateusz K.

Mateusz Kowalczyk
It'd be nice if we could get the result of htmlTree without having to write it out to the file.
htmlTree file = writeFile file . showTreeHtml . enumTree so, just export 'showTreeHtml . enumTree' I am reading 'String', '++' and 'concat' all over the place and that makes me somewhat nervous about performance. I thought 'showTreeHtml' should produce some abstract Html representation (say, Text.Blaze.Html), then the user can decide how to render, and to what type (String, Text, ByteString). - J.W.

2014-01-13 13:01, J.Waldmann skrev:
Mateusz Kowalczyk
writes: It'd be nice if we could get the result of htmlTree without having to write it out to the file.
htmlTree file = writeFile file . showTreeHtml . enumTree
so, just export 'showTreeHtml . enumTree'
OK, I didn't think there was a use case for this, but I have fixed it now.
I am reading 'String', '++' and 'concat' all over the place and that makes me somewhat nervous about performance.
Yes, but note that `++` is only used on single lines. If anyone runs into performance issues, feel free to submit a patch.
I thought 'showTreeHtml' should produce some abstract Html representation (say, Text.Blaze.Html), then the user can decide how to render, and to what type (String, Text, ByteString).
That sounds like a good idea! Personally I'm only interested in very simple use cases. But please go ahead if anyone wants to add more flexible outputs. / Emil
participants (3)
-
Emil Axelsson
-
J. Waldmann
-
Mateusz Kowalczyk