Skip to content

Instantly share code, notes, and snippets.

@dmalikov
Created July 28, 2013 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmalikov/6098556 to your computer and use it in GitHub Desktop.
Save dmalikov/6098556 to your computer and use it in GitHub Desktop.
nice module-management package
import Control.Monad (($), forM, undefined)
main = forM [] $ undefined
import Control.Monad (forM, forM_)
main = forM [] $ undefined
@dmalikov
Copy link
Author

$> :m + Language.Haskell.Modules.Imports Language.Haskell.Modules.Params
$> runCleanT $ cleanImports ["before.hs"]

@ddssff
Copy link

ddssff commented Jul 30, 2013

Believe it or not, this is a bug in GHC. If you run

ghc -c -ddump-minimal-imports before.hs

on the file before.hs, you will see this in Main.imports:

import Control.Monad ( ($), undefined, forM )

Here is the GHC ticket for this issue, it should be fixed in 7.8 but in the meantime just add a module line or amything else above the first import:

http://ghc.haskell.org/trac/ghc/ticket/7476

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment