-
Notifications
You must be signed in to change notification settings - Fork 37
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
new hardline behavior changes multiline strings #189
Comments
Oh! Could you share the code that produces this output? |
Ah, I think I get it, and the culprit is indeed #139. I hadn't expected that the whitespace produced by indenting empty lines could be significant, and I still kind of feel that it shouldn't be. In Dhall, this leading whitespace doesn't matter, and in fact the In your case, you can simply annotate each line of the multi-line string. The annotation then prevents the layouter from perceiving the line as empty, so it will always produce the space characters. |
That might be the thing to here! And thanks for the pointer w.r.t. annotations :) |
You're welcome, @vmchale! :) I'm somewhat wondering whether this is something that we should document in the haddocks… I'm not sure where though. Let's maybe see whether this is an issue that more people will stumble upon. |
With prettyprinter (due to #139 I think) <1.7 it prints
With the new behavior, this is:
Unfortunately there's no way to say "keep indentation that would otherwise be blank after newline" - and getting rid of the empty whitespace changes the meaning of the whole string (I think something similar might happen in Dhall?).
Perhaps a new combinator?
The text was updated successfully, but these errors were encountered: