:r myfile.hs does nothing

Neil Mitchell ndmitchell at gmail.com
Thu Oct 25 07:14:47 EDT 2007


Hi

While teaching beginners I noticed that about 5 of them made the same
mistake. They were typing ":r filename.hs" to load a file, which
doesn't load a file, but reloads the currently active module (the
Prelude in this case). It was made worse by the fact that their file
was sum.hs and contained an implementation of sum which they had to
test - and the Prelude version hid their error.

Is there anything that can be typed after ":r" which gives the command
any effect? If not, perhaps ":r anything" should be reported to the
user as a warning or an error. To compare to GHC's behaviour:

GHCi
Prelude> :r
Ok, modules loaded: none.
Prelude> :r foo.hs
module does not exist
Prelude>

Thanks

Neil


More information about the Hugs-Bugs mailing list