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 (#<|) and deprecate its alias (<|#) #9

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

wismill
Copy link
Contributor

@wismill wismill commented Sep 1, 2023

Previously the documentation stated that (#<|) was not supported by the parser. It turns out it is a silly interaction with -XUnboxedTuples. Adding extra spacing between the parentheses and the function fixes the issue.

This commit adds (#<|) and makes (<|#) its deprecated alias.

@wismill
Copy link
Contributor Author

wismill commented Sep 1, 2023

Note: fourmolu does not support this fix and suppresses the spaces in ( #<| ). See tweag/ormolu#1062.

For now, I use fourmolu’s special comments to disable formatting at the corresponding lines.

@Bodigrim
Copy link
Owner

Bodigrim commented Sep 1, 2023

Thanks, interesting!

Could you please mention the caveat about spaces around ( #<| ) in documentation? Lest users are tricked the same way I was.

I'm a bit reluctant to accumulate pragmas and would rather wait for Ormolu / Formolu to fix the formatting issue.

@wismill
Copy link
Contributor Author

wismill commented Sep 2, 2023

Could you please mention the caveat about spaces around ( #<| ) in documentation?

I added a mention about the caveat in the doc and in the code.

Lest users are tricked the same way I was.

I discovered this caveat by mere curiosity: GHC had no issue with a #<| b but had with (#<|). So it is indeed not obvious!

I'm a bit reluctant to accumulate pragmas and would rather wait for Ormolu / Formolu to fix the formatting issue.

Agreed. I reduced to only one comment at the beginning of the file. A fix is already in the work, see tweag/ormolu#1063. I do not think you should wait for a formatting tool to be fixed to merge this PR, as it introduces a deprecation in a young library: the sooner you release, the lesser users will need migration.

Previously the documentation stated that `(#<|)` was not supported by the
parser. It turns out it is a silly interaction with `-XUnboxedTuples`.
Adding extra spacing between the parentheses and the function fixes the
issue.

This commit adds `(#<|)` and makes `(<|#)` its deprecated alias.
@wismill wismill force-pushed the fix/symmetric-prepend-addr branch 2 times, most recently from f3eb282 to 1999f3b Compare September 5, 2023 09:44
@wismill
Copy link
Contributor Author

wismill commented Sep 5, 2023

Rebased. I tested with success formatting with fourmolu using the patch at tweag/ormolu#1063.

@Bodigrim
Copy link
Owner

Bodigrim commented Sep 6, 2023

Waiting for fourmolu/fourmolu#369 to be released.

@wismill
Copy link
Contributor Author

wismill commented Sep 7, 2023

@wismill
Copy link
Contributor Author

wismill commented Sep 7, 2023

I removed the commit with the special Fourmolu comments.

@Bodigrim Bodigrim merged commit bee5338 into Bodigrim:master Sep 7, 2023
6 checks passed
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