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

Format imports qualified post #334

Closed
cblp opened this issue Oct 28, 2020 · 2 comments · Fixed by #372 · May be fixed by #335
Closed

Format imports qualified post #334

cblp opened this issue Oct 28, 2020 · 2 comments · Fixed by #372 · May be fixed by #335

Comments

@cblp
Copy link
Contributor

cblp commented Oct 28, 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
@cblp
Copy link
Contributor Author

cblp commented Oct 28, 2020

#284 only added support for reading this code, now I want stylish to write it.

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 <[email protected]>
@cblp
Copy link
Contributor Author

cblp commented Jul 18, 2021

Great! Thanks!

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