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

Necessary ViewPatterns pragma removed #75

Closed
snoyberg opened this issue Oct 7, 2014 · 2 comments
Closed

Necessary ViewPatterns pragma removed #75

snoyberg opened this issue Oct 7, 2014 · 2 comments

Comments

@snoyberg
Copy link
Contributor

snoyberg commented Oct 7, 2014

In Yesod 1.4, route pattern matching is done via generating code that using ViewPatterns. This means that, while the source code itself doesn't actually take advantage of ViewPatterns, the generated code requires the language pragma to be turned on. As a result, each time I run stylish-haskell on a Yesod application, it removes ViewPatterns and breaks compilation.

Would it be possible to disable the automatic removal of ViewPatterns?

@jaspervdj
Copy link
Member

You can disable automatic removal of all language pragmas by setting
remove_redundant to false for that step in the default configuration file.

More granular control is currently not available, do you think it is worth
having?

@snoyberg
Copy link
Contributor Author

snoyberg commented Oct 7, 2014

Nope, that's certainly good enough for my purposes, thanks!

@snoyberg snoyberg closed this as completed Oct 7, 2014
iustin added a commit to iustin/corydalis that referenced this issue Feb 21, 2018
Hit by haskell/stylish-haskell#75, so
let's add the default configs with the remove_redundant set to false;
hlint already notifies about these.
pbrisbin added a commit to restyled-io/restyled.io that referenced this issue Jun 4, 2018
Can't trim redundant language pragmas because it incorrectly removes
ViewPatterns.

haskell/stylish-haskell#75

Would prefer to not do this globally in my main dotfiles, so...
pbrisbin added a commit to restyled-io/restyled.io that referenced this issue Jun 4, 2018
- Use remote_files for restyler (also turn on brittany)
- Manually curl in CI for hlint

N.B. We can't use remote stylish-haskell config because of a bug related
to ViewPatterns: haskell/stylish-haskell#75
pbrisbin added a commit to restyled-io/restyled.io that referenced this issue Jun 4, 2018
- Use remote_files for restyler (also turn on brittany)
- Manually curl in CI for hlint

N.B. We can't use remote stylish-haskell config because of a bug related
to ViewPatterns: haskell/stylish-haskell#75
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

No branches or pull requests

2 participants