[ ghc-Bugs-453587 ] Loading modules without .hs file fails

noreply@sourceforge.net noreply@sourceforge.net
Tue, 21 Aug 2001 02:42:25 -0700


Bugs item #453587, was opened at 2001-08-20 18:50
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=108032&aid=453587&group_id=8032

>Category: Compiler
Group: 5.00
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Shane Stephens (shane_308)
>Assigned to: Simon Marlow (simonmar)
Summary: Loading modules without .hs file fails

Initial Comment:
If I attempt to load a module with only the .hi and .o
files for that module present, then the load fails with
the following message:

Loading package std ... linking ... done.
Prelude> :l Part1
*** Exception: does not exist
Action: withFileStatus
Reason: No such file or directory
Prelude> 

However, by placing a 'dummy' .hs file with only the
single line:

module Part1 where

I can get the module Part1 to load _with full
functionality_.

This error is present in ghci 5.00.2 on a i86pc running
SunOS 5.8



----------------------------------------------------------------------

>Comment By: Simon Marlow (simonmar)
Date: 2001-08-21 02:42

Message:
Logged In: YES 
user_id=48280

This has been fixed in a rather heavy-handed way: GHC 5.02 
won't allow you to load modules for which there is no 
source file, unless the module is from a package.

The reason is that GHCi follows dependencies by reading the 
source file, so it can't figure out dependencies if the 
source isn't available.  Your workaround of providing a 
dummy source file will still work (but it should contain 
import declarations for any modules it depends on).

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=108032&aid=453587&group_id=8032