Another H'98 Report query

Iavor S. Diatchki diatchki@cse.ogi.edu
Thu, 31 Jan 2002 10:55:12 -0800


hi again, 

On Thursday 31 January 2002 10:18 am, Malcolm Wallace wrote:
> > disallowing all duplicates seems tricky.  is there a duplicate here:
> >
> > module A (f, module M) where
> > import M(f)
>
> Yes, there is a duplicate here.  Strangely enough, hbc does not report
> this as an error, even though it refuses to compile the following
> very similar case:
>
>   module A (f, module A) where
>   f = id
>
>   $ hbc -c A.hs
>   Errors:
>   "A.hs", line 0, [87] Duplicates in export list: f
>   Compilation aborted

weird! ghc accepts both of them and i like that.  i think perhaps syntactic 
duplicates should be reported as erros or warnings, i.e. writing the same 
thing twice in an export list is likely to be because of a "copy & paste" 
error.  however "sematic" duplicates (i.e. the same entity named in two 
different ways) should not be.  here is another example:

module A(module B, module C)
import B
import C

if B and C happen to export the same entity should this be an overlap error?  
i hope not, as it will force me to explicitly list the exports of the one 
module, which do not overlap with the other.  this should be the job of the 
module system.

bye
iavor