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 option to remove pragmas implied by the language variant #455

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mrBliss
Copy link
Contributor

@mrBliss mrBliss commented May 26, 2023

For example, by setting language_variant to GHC2021, all the extensions implied by the GHC2021 language variant will be removed as redundant language pragmas.

For example, by setting `language_variant` to `GHC2021`, all the extensions
implied by the GHC2021 language variant will be removed as redundant language
pragmas.
# - Haskell98
#
# Default: Haskell2010
language_variant: Haskell2010
Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. I was considering whether there should be a way to retain the former behaviour of remove_redundant: true, i.e., just remove BangPatterns and ViewPatterns when unused in the module. I decided not to add it because I couldn't think of a good way to make it fit the language_variant option (which language variant would that option be?) and the usefulness of the former behaviour is rather limited, IMHO.

  2. What about projects that are mix of different language variants? The mix would be across components (library vs. testsuite, etc.)

@michaelpj
Copy link
Contributor

This would be great to have! Could we also parse this setting out of the .cabal file like we do for default-extensions? I don't think that would directly solve your problem about different components with different languages (e.g. for default extensions it seems that we just take the union of all default extensions across all components!), but it's a step in the right direction.

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