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

Special handling for GHC20xx pragmas #922

Closed
georgefst opened this issue Sep 20, 2022 · 1 comment · Fixed by #923
Closed

Special handling for GHC20xx pragmas #922

georgefst opened this issue Sep 20, 2022 · 1 comment · Fixed by #923
Labels
feature-request style Nitpicking and things related to purely visual aspect for formatting.

Comments

@georgefst
Copy link

I feel that {-# LANGUAGE GHC2021 #-} (and Haskell2010 and Haskell98, but I've never actually seen these used on a per-module basis) should always be bumped to the top of the list of language pragmas. Currently it's just sorted alphabetically with the others. But it's more important than others. I think files are more readable with it at the top, since it leads to a more logical thought process of "this is the base language in use, and then these are the ways in which we differ from that language".

There's already special handling for certain language pragmas, e.g. those beginning No.

@amesgen
Copy link
Member

amesgen commented Sep 20, 2022

FTR: Previous, similar discussion that inspired that the existing way of sorting of language pragmas: #404

It seems sensible to put GHC2021 and friends at the top; this should be trivial to implement and I don't see any tricky interactions right now.

Also, as an aside, impliedXFlags is now exported, so we could make use of that to avoid hardcoding CUSKs and NoImplicitPrelude (even though those are still the only extensions turned off by other extensions). Or (not sure if this is a good idea) even going further, it could automatically remove language pragmas already implied by other pragmas.

@mrkkrp mrkkrp added feature-request style Nitpicking and things related to purely visual aspect for formatting. labels Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request style Nitpicking and things related to purely visual aspect for formatting.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants