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 for ImportQualifiedPost GHC extension #369

Open
sonowz opened this issue Apr 1, 2022 · 1 comment
Open

Support for ImportQualifiedPost GHC extension #369

sonowz opened this issue Apr 1, 2022 · 1 comment

Comments

@sonowz
Copy link

sonowz commented Apr 1, 2022

(This is a feature request)

GHC 8.10.1 introduced a new extension called ImportQualifiedPost.
Basically what it allows is the following syntax:

import A qualified
import B qualified as C

Since the extension is included in the upcoming Haskell standard after Haskell2010, namely GHC2021, I think it would be nice for brittany to have an option to use the new syntax. Any thoughts?

@sonowz
Copy link
Author

sonowz commented Apr 5, 2022

I think adding a config named like _lconfig_importQualifiedPost :: f (Last Bool) below could work...

data CLayoutConfig f = LayoutConfig
{ _lconfig_cols :: f (Last Int) -- the thing that has default 80.
, _lconfig_indentPolicy :: f (Last IndentPolicy)
, _lconfig_indentAmount :: f (Last Int)
, _lconfig_indentWhereSpecial :: f (Last Bool) -- indent where only 1 sometimes (TODO).
, _lconfig_indentListSpecial :: f (Last Bool) -- use some special indentation for ","
-- when creating zero-indentation
-- multi-line list literals.
, _lconfig_importColumn :: f (Last Int)
-- ^ for import statement layouting, column at which to align the
-- elements to be imported from a module.
-- It is expected that importAsColumn >= importCol.
, _lconfig_importAsColumn :: f (Last Int)
-- ^ for import statement layouting, column at which put the module's
-- "as" name (which also affects the positioning of the "as" keyword).
-- It is expected that importAsColumn >= importCol.

I'm feeling like this work needs few changes in the codebase and I can work on it. I'll try 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants