[Hugs-users] Hugs98-plus-Sept2006

Ross Paterson ross at soi.city.ac.uk
Sat Dec 9 18:35:25 EST 2006


On Sat, Dec 09, 2006 at 11:11:21PM +0000, dfeustel at 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

	/usr/local/lib/hugs/packages/*/A/B/C.{hs,lhs}

(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".



More information about the Hugs-Users mailing list