better error message needed for missing package files
Here's a real user's confusion:
~ $ ghci GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help Loading package base ... linking ... done. Prelude> :module Network Could not find module `Network': Use -v to see a list of the files searched for. Prelude> Leaving GHCi. ~ $ ghc-pkg list network /usr/lib/ghc-6.8.2/package.conf: network-184.108.40.206 /home/sjm/.ghc/i386-linux-6.8.2/package.conf: network-220.127.116.11
Turns out the problem is that the
network-18.104.22.168 package that is registered locally is messed up, the .hi files are missing, probably accidentally deleted.
In this situation the error message is not very helpful. The current error message makes sense in the context of local files since there is is quite reasonable for them to not exist however it's no good at all for the case of a module from a package. We know that the package exports that module so the file had better exist and if it does not, it's not simply a case of a missing file, the package is totally borked. The user needs to know that the package is borked so that they can unregister or reinstall it. The current message does not alert them to the real problem.
The message should say which package (including version) claims to provide the module and that files are missing from the installed package and as such the package is unusably broken and should be reinstalled.