[GHC] #7476: -ddump-minimal-imports confused if first line is an import
GHC
cvs-ghc at haskell.org
Mon Dec 3 20:10:36 CET 2012
#7476: -ddump-minimal-imports confused if first line is an import
-----------------------------+----------------------------------------------
Reporter: dag | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Blockedby:
Blocking: | Related:
-----------------------------+----------------------------------------------
On reddit, Chris Done posted this example:
{{{
chris at midnight:~$ cat > x.hs
import Control.Applicative
main = show <$> pure 1 >>= print
chris at midnight:~$ ghc x.hs -ddump-minimal-imports
[1 of 1] Compiling Main ( x.hs, x.o )
Linking x ...
cachris at midnight:~$ cat Main.imports
import Control.Applicative
( print, (>>=), show, Applicative(pure), (<$>) )
}}}
I noted that this is wrong, for example {{{print}}} isn't exported from
{{{Control.Applicative}}}:
{{{
>>> import Control.Applicative (print)
<interactive>:1:29:
Module `Control.Applicative' does not export `print'
}}}
hvr explains: ''for some reason GHC gets confused if the very first string
in the .hs file is import; try adding anything, such as a newline or
module Main where and it works as expected...''
I couldn't find a relevant bug for this.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7476>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list