lspitzner / brittany

haskell source code formatter
GNU Affero General Public License v3.0
692 stars 72 forks source link

Support for `ImportQualifiedPost` GHC extension #369

Open sonowz opened 2 years ago

sonowz commented 2 years ago

(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 commented 2 years ago

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

https://github.com/lspitzner/brittany/blob/0aa04af4eba499b81fdfb401d98414e7731583cc/source/library/Language/Haskell/Brittany/Internal/Config/Types.hs#L41-L56

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