Hi, (I know that Hugs does not claim to implement the whole module system, but I consider the following a bug anyway.) Consider the following 4 modules: module Top where import C main = print "koe" module C( module A, module B ) where import A hiding ( apa ) import B hiding ( apa ) module A where apa = "one" module B where apa = "two" Hugs does not complain when loading C (and indeed it shouldn't), but complains about importing C (conflict with the function "apa") when loading Top. This is the February 2000 version of Hugs running on SunOS. /Koen. -- Koen Claessen http://www.cs.chalmers.se/~koen phone:+46-31-772 5424 mailto:koen@cs.chalmers.se ----------------------------------------------------- Chalmers University of Technology, Gothenburg, Sweden
Just to pin down Koen's bug a little more closely... Haskell says that: module A (module B) where ... should only export those parts of B that were imported from B. So, if you use 'hiding' or an explicit import list, the hidden entities should not be re-exported. But what Hugs does is to export everything exported from B whether it was imported into A or not. If anyone feels like fixing this, I'm pretty sure that Hugs maintains: 1) A list of all entities in scope in each module. 2) A list of all entities exported by each module. Hugs currently uses (2). Haskell requires that it use the intersection of (1) and (2). -- Alastair Reid
participants (2)
-
Alastair Reid -
Koen Claessen