On Sat, Dec 09, 2006 at 11:11:21PM +0000, dfeustel@mindspring.com wrote:
the 'find' command does not find a file by the name of Hugs.Prelude anywhere in the Hugs98 tree or in /usr/local/lib/hugs, nor in the default path, as far as I can tell. There are, þowever, 5 different instances of Prelude.hs in the Hugs98 tree. Why is there more than 1 instance of Prelude.hs (with different contents to boot) in Hugs98 source?
% find /usr/local/lib/hugs -name Prelude.hs | xargs grep ^module /usr/local/lib/hugs/packages/hugsbase/Hugs/Prelude.hs:module Hugs.Prelude ( /usr/local/lib/hugs/packages/base/Prelude.hs:module Prelude (
They are different modules, with the second (the Prelude, as defined in Haskell 98) importing the first (Hugs.Prelude, the internal Hugs implementation). The search path contains /usr/local/lib/hugs/packages/*, so when asked to load module A.B.C, Hugs looks for
As I read more of the Hugs documentation, I am getting the impression that the documentation terms are changing to reflect a change in the software organization.
(section 2.2 of the Hugs User's Guide) The point is that if the file thus found does not describe itself as module A.B.C, the load will fail. Now plug Hugs.Prelude and Prelude into the above, and we get the behaviour you are seeing. The problem is that you have a file Prelude.hs in your search path that does not start with "module Prelude".
The Prelude.hs in my $HOME is a copy of the Prelude.hs in packages/hugsbase/Hugs/Prelude.hs - the 65355 char version. (Note the difference in file sizes. It looks like the small Prelude.hs is just the Hugs.Prelude module.) find . -name Prelude.hs -ls 65355 Dec 8 18:51 ./packages/hugsbase/Hugs/Prelude.hs 4100 Dec 8 18:51 ./packages/base/Prelude.hs Dave