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

Add streaming pretty printing utilities #567

Merged
merged 11 commits into from
Mar 22, 2024
Merged

Add streaming pretty printing utilities #567

merged 11 commits into from
Mar 22, 2024

Conversation

satabin
Copy link
Member

@satabin satabin commented Jan 29, 2024

It is inspired by the paper Lazy v. Yield: Incremental, Linear Pretty-printing by Oleg Kiselyov, Simon Peyton-Jones, and Amr Sabry.

It adds indentation and alignment features to be useful in the context of streaming tree structure pretty printing (XML, JSON, ...).

Any type that has an instance of Renderable can be printed.

The printer guarantees that the data is printed as early as possible and the it is correct up to the first malformed tree structure.

@satabin satabin force-pushed the text/pretty branch 7 times, most recently from 8c70975 to 1f10182 Compare January 31, 2024 18:13
satabin added 9 commits March 17, 2024 20:26
It is inspired by the paper _Lazy v. Yield: Incremental, Linear
Pretty-printing_ by Oleg Kiselyov, Simon Peyton-Jones, and Amr Sabry.
It adds indentation and alignment features to be useful in the context
of streaming tree structure pretty printing (XML, JSON, ...).

Any type that has an instance of `Renderable` can be printed.

The printer guarantees that the data is printed as early as possible
and the it is correct up to the first malformed tree structure.
@satabin satabin marked this pull request as ready for review March 17, 2024 19:40
@satabin satabin requested a review from a team as a code owner March 17, 2024 19:40
@satabin satabin requested a review from ybasket March 17, 2024 19:40
@satabin satabin added the enhancement New feature or request label Mar 18, 2024
@satabin satabin added this to the 1.11.0 milestone Mar 18, 2024
Copy link
Collaborator

@ybasket ybasket left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some questions and nitpicks, but overall, things look good 👍

Co-authored-by: Yannick Heiber <[email protected]>
@satabin satabin enabled auto-merge March 22, 2024 16:45
@satabin satabin merged commit 484af9a into main Mar 22, 2024
28 checks passed
@satabin satabin deleted the text/pretty branch March 22, 2024 16:47
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

Successfully merging this pull request may close these issues.

2 participants