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

Support Haskell2010 as pragma #106

Open
jan-christiansen opened this issue Dec 10, 2024 · 2 comments
Open

Support Haskell2010 as pragma #106

jan-christiansen opened this issue Dec 10, 2024 · 2 comments

Comments

@jan-christiansen
Copy link
Contributor

jan-christiansen commented Dec 10, 2024

Haskell2010 is an official GHC extension (https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/table.html) and used in yi-editor/yi (https://github.com/yi-editor/yi/blob/13fa0f7c598a115485572b66fed5bc3cf383d0ef/yi-core/src/Yi/PersistentState.hs#L5), for example. I suggest to support this extension by replacing

readExtension :: String -> Maybe Extension

with

readExtension :: String -> [Extension]

and yield default2010Extensions in the case of Haskell2010.

If this is fine, I will create a pull request.

@tomjaguarpaw
Copy link
Collaborator

Thanks. Perhaps we do have to do something about that, but I am somewhat surprised that this feature doesn't exist already. The authors would have been aware of Haskell2010. That makes me think there is a good reason it is omitted.

@jan-christiansen
Copy link
Contributor Author

Good point, perhaps it is because languages are handled orthogonally to pragmas by Cabal and my approach is rather a hack to make the parser succeed : ) You are right, in my approach the parser would actually successfully parse NoHaskell2010 : ) As this should obviously not be allowed, adding support for language pragmas would require a larger refactor and explicitly handling language extensions.

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