[m-rev.] diff: Delete unused imports.

Zoltan Somogyi zoltan.somogyi at runbox.com
Wed Mar 30 14:09:03 AEDT 2022



On Wed, 30 Mar 2022 13:26:36 +1100, Peter Wang <novalazy at gmail.com> wrote:
> > The main reason why you have to import a module A in the interface
> > of module B is that one of the arguments of a predicate or function
> > exported by module B refers to a type defined in module A.
> 
> But does a module C that only calls the predicate/function exported by
> module B also need to import module A?

No, it does not, but that is not the point I was trying to make. The sentence
you quoted was not making an argument; it was only a prelude to the argument
in the next paragraph.

> The type defined in module A is
> never explicitly named in module C, nor constructed/deconstructed in
> module C, so does it count as a "use"?

I am not talking about any third module C at all.

I am saying that module B needs to import module A if one of its variables
has a type that contains a type constructor defined in module A.

> The reference manual doesn't
> explain what it considers a "use".

Module A uses module B if it needs information from module B's interface
to compile properly. While could and probably should give examples of
what counts as as use, I think we should avoid any statement of the form
"the above uses are the only possible uses", since such statements
could be invalidated by future changes to the language.

Zoltan.





More information about the reviews mailing list