#1792: -ddump-minimal-imports breaks qualified imports (import...as)
-------------------------+--------------------------------------------------
    Reporter:  guest     |        Owner:             
        Type:  bug       |       Status:  new        
    Priority:  low       |    Milestone:  6.10 branch
   Component:  Compiler  |      Version:  6.6.1      
    Severity:  minor     |   Resolution:             
    Keywords:            |   Difficulty:  Unknown    
          Os:  Unknown   |     Testcase:             
Architecture:  Unknown   |  
-------------------------+--------------------------------------------------
Changes (by simonpj):

  * priority:  normal => low
  * milestone:  => 6.10 branch

Old description:

> When using the -ddump-minimal-imports option on a Haskell file, it breaks
> qualified imports.
>
> Ie, suppose one has a line in a file thus:
>
>  import qualified Data.ByteString as B (putStr, readFile)
>
> Using -ddump-minimal-imports will give you something like this:
>  import Data.ByteString(B.putStr, B.readFile)
>
> There are 3 things wrong here:
>
> #putStr and readFile should not be renamed thus, as obviously
> Data.ByteString has nothing under those names
>
> #Data.ByteString is no longer being imported under a different name, so
> all function uses relying on B.putStr etc. will break
>
> #Finally, it's just ugly to have no spaces between the last letter of the
> module's name and the opening parenthesis.
>
> I see this behavior under GHC 6.6.1, and asl of #haskell tells me he
> duplicated the import problem using GHCi version 6.8.0.20071019.
>
> --
> gwern

New description:

 When using the `-ddump-minimal-imports` option on a Haskell file, it
 breaks qualified imports.

 Ie, suppose one has a line in a file thus:
 {{{
  import qualified Data.ByteString as B (putStr, readFile)
 }}}
 Using `-ddump-minimal-imports` will give you something like this:
 {{{
  import Data.ByteString(B.putStr, B.readFile)
 }}}
 There are 3 things wrong here:

  * `putStr` and `readFile` should not be renamed thus, as obviously
 `Data.ByteString` has nothing under those names

  * `Data.ByteString` is no longer being imported under a different name,
 so all function uses relying on `B.putStr` etc. will break

  * Finally, it's just ugly to have no spaces between the last letter of
 the module's name and the opening parenthesis.

 I see this behavior under GHC 6.6.1, and asl of #haskell tells me he
 duplicated the import problem using GHCi version 6.8.0.20071019.

 --
 gwern

Comment:

 Good point. This is one of those fiddly things, and few people use it.  So
 I'm going to put it as low priority, currently provisionally in the 6.10
 queue.

 Others: pls yell and add yourselves to the cc list if you use `-ddump-
 minimal-imports`.

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1792#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to