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

Inside-out Printing #20

Open
justinpombrio opened this issue Mar 8, 2024 · 0 comments
Open

Inside-out Printing #20

justinpombrio opened this issue Mar 8, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@justinpombrio
Copy link
Owner

Make printing even more peephole-optimized by printing from the "inside out". This is a pie-in-the-sky enhancement.

How this could be done:

  • Give PrettyDoc a parent() method. (This means implementors won't be able to be just a &struct Tree(Vec<Tree>) anymore.)
  • Have pretty_print() take a PrettyDoc node to print at instead of a path: Vec<usize>.
  • When printing, start at the focal node and print "up". This would be a big change to the printing algorithm. But possible, since Notations are so declarative: e.g. it's possible to start in the middle of a fold.
@justinpombrio justinpombrio added the enhancement New feature or request label Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant