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

Automatic multiline printing using prettyprinter #11

Merged
merged 7 commits into from
Aug 7, 2020

Conversation

srghma
Copy link
Collaborator

@srghma srghma commented Aug 4, 2020

Replaced boxes lib with this jmackie/purescript-prettyprinter#3

@srghma
Copy link
Collaborator Author

srghma commented Aug 4, 2020

@paluh @flip111 @jvliwanag the work is finished

you can check the tests to see the changes

Why prettyprinter?

this lib can automatically determine if expression needs to be printed in one-line (aka. flattened) or in multiline

What the experience of using prettyprinter is like

first, you write your code in a multiline fashion (vcat func for example), in respective places you use FlatAlt multilineDoc flattenedDoc constructor (e.g. vcat is using it internally)

then you wrap your inputDoc in group function so it flattens your inputDoc and constructs Union newFlattenedDoc inputDocNotChanged

Question to you guys?

do you mind if I create a fork of https://github.com/jmackie/purescript-prettyprinter with my changes in this organization,

since orignal author doesn't want to be involved jmackie/purescript-prettyprinter#2 ?

@srghma
Copy link
Collaborator Author

srghma commented Aug 4, 2020

actually I would even rename it to prettyprinter-renderable (because the implementation is different from haskell's version)

and publish ps-cst and prettyprinter-renderable (question is here jmackie/purescript-prettyprinter#2 (comment) )

@flip111
Copy link
Member

flip111 commented Aug 6, 2020

do you mind if I create a fork of https://github.com/jmackie/purescript-prettyprinter with my changes in this organization,

Please go ahead with this. I can't do any more review at the moment since i'm very busy in personal life. Maybe in the fall or winter i and others can be more involved again. Thanks again for the great work !

@srghma srghma merged commit 382fe4a into purescript-codegen:master Aug 7, 2020
@srghma
Copy link
Collaborator Author

srghma commented Aug 7, 2020

Thx, will create repo later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants