-
Notifications
You must be signed in to change notification settings - Fork 183
Unicode 2d drawing for Data.Tree #344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I'm sorry I haven't commented on this; I somehow failed to see it come in. I think this is an intriguing idea. I'm not opposed to it, but I am concerned about the potential for a profusion of different tree drawing routines. Does it really make sense to put this in Data.Tree
, or somewhere else? I think the best way to answer that question would be for you to send a proposal to libraries@haskell.org and see what the community thinks.
@m-renaud I think this is probably the best example we've seen so far of something that might go in a containers-extra
package. It's obviously useful, and it almost as obviously doesn't belong in containers
.
I'm a bit unsure what to do about this PR.
On first sight this does seem like an improvement on the existing ASCII drawing functions – it's more polished and more compact, and therefore better suited to visualizing large trees.
I'm also not so concerned about increasing the API size – Data.Tree
is a tiny module and the drawing functions are a very specialized corner of that API. I'd be more worried about adding another unfold*
variant.
I frankly don't know who actually uses Data.Tree
, but I think that any users would find this very useful.
it almost as obviously doesn't belong in containers
Do you still think so? Can you say more about your reasoning?
Also, @paolino, are you still interested at all in this PR?
My reasoning is that it's a data structure library, not a data structure visualization library. But my resistance has softened. I would want to try to gauge community sense by asking the libraries list though; that's the containers
tradition .
3noch
commented
Jul 17, 2020
I suppose you would prefer that the existing ASCII drawing functions were never added and are only kept for backwards compat?
@3noch, probably. But then again, these things can be very helpful for people trying to use the package, so I'm of two minds. Happy to let the community decide this one.
I frankly don't know who actually uses
Data.Tree
Just a data point: I do, and precisely for the ASCII art.
Part of an auto-grader (https://gitlab.imn.htwk-leipzig.de/autotool/all0/ )
it sometimes prints derivation trees w.r.t. CF grammars and such.
Yes, since we ultimately output HTML, we can also do inline (SVG, PNG) graphics, but sometimes we don't, since the ASCII stuff is good enough - and students should learn to abstract anyway ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I currently see mainly two questions that could profit from a wider discussion:
- Should these functions be added or are there important concerns against adding them in their current form?
- What names should the functions have? (I'm not very fond of abbreviations. I'd prefer
drawTreeUnicode
overdrawTreeU
)
While I've become somewhat wary of the way that discussions on the libraries list tend to go, the mailing list still seems like the appropriate place for this discussion.
Please do comment here after sending the proposal, so I can help shepherd the discussion a bit.
Also, the discussion doesn't necessarily need to be started by @paolino – if anyone else wants to drive this PR forward, you're welcome! :)
Better 2D drawing with Unicode, Also it takes 1/2 lines
2d tree unicode