Skip to content
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

Unicode 2d drawing for Data.Tree #344

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

paolino
Copy link

@paolino paolino commented Sep 25, 2016

Better 2D drawing with Unicode, Also it takes 1/2 lines
2d tree unicode

@paolino paolino changed the title Unicode 2d drawing for Data.Graph Unicode 2d drawing for Data.Tree Sep 25, 2016
@treeowl
Copy link
Contributor

treeowl commented Dec 15, 2016

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 [email protected] and see what the community thinks.

@treeowl
Copy link
Contributor

treeowl commented Jan 9, 2018

@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.

@sjakobi
Copy link
Member

sjakobi commented Jul 17, 2020

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.

@treeowl

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?

@treeowl
Copy link
Contributor

treeowl commented Jul 17, 2020

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
Copy link

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?

@treeowl
Copy link
Contributor

treeowl commented Jul 17, 2020

@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.

@jwaldmann
Copy link
Contributor

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 ...

Copy link
Member

@sjakobi sjakobi left a 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 over drawTreeU)

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! :)

@sjakobi sjakobi added the needs-libraries-proposal A proposal needs to be discussed on the libraries mailing list label Jul 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request needs-libraries-proposal A proposal needs to be discussed on the libraries mailing list Tree
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants