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 ImportQualifiedPost #284

Closed
cblp opened this issue Jun 19, 2020 · 5 comments
Closed

Support ImportQualifiedPost #284

cblp opened this issue Jun 19, 2020 · 5 comments

Comments

@cblp
Copy link
Contributor

cblp commented Jun 19, 2020

Starting from GHC 8.10, with this extension enabled, one can write:

import A qualified
import B
import C

Now we can save 10 spaces on non-qualified imports!

module Bad where

import Control.Applicative ((<$>))
import System.Directory    (doesFileExist)

import Data.Map            (Map, keys, (!))
import Data.Map            qualified as M
@EncodePanda
Copy link
Contributor

Yes, we need that as well at work :)
Stylish-haskell must first switch to a new parser library (from haskell-src-ext to ghc-lib-parser) in order for us to provide this feature.

@cblp
Copy link
Contributor Author

cblp commented Jun 19, 2020

HLint can tell a success story about such transition.

@EncodePanda
Copy link
Contributor

HLint is a good inspiration :)

@jaspervdj
Copy link
Member

This should be fixed by #307.

@cblp
Copy link
Contributor Author

cblp commented Oct 11, 2020

cool!

jhmcstanton added a commit to jhmcstanton/stylish-haskell that referenced this issue Oct 30, 2020
Adds an option to use post qualified module imports.

Related to haskell#284
Resolves haskell#334
akrmn added a commit to akrmn/stylish-haskell that referenced this issue Nov 19, 2020
akrmn pushed a commit to akrmn/stylish-haskell that referenced this issue Jul 12, 2021
Adds an option to use post qualified module imports.

Related to haskell#284
Resolves haskell#334
akrmn added a commit to akrmn/stylish-haskell that referenced this issue Jul 12, 2021
lukasz-golebiewski pushed a commit that referenced this issue Jul 16, 2021
* Add support for post qualified import formatting.

Adds an option to use post qualified module imports.

Related to #284
Resolves #334

* Add failing test cases for post qualified import formatting.
  
Related to #284 and #334

* Fix imports test case 33 - 'qualified' goes before imported names

* Consolidate import module name logic

Co-authored-by: Jim McStanton <jim@jhmcstanton.com>
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

3 participants