archives

Types from imported modules "leaking" into a module's public interface

In my ongoing inquiry into module semantics and language treatment of module systems, this seems like a an extremely broad "problem" insofar as 1) it may easily and often infect module designs and implementations; 2) it can create a host of implicit dependencies upon a module "user" (or "importer", etc.); and 3) might be addressed in many ways, both in terms of module design and language design.

In particular, I can imagine a language where a set of "public modules" S(M), whose types "infect" the public interface (arguments and return types) of a new module M1 which imports/uses S(M), are automatically "imported" into any other another module M* that uses or imports M1. Thus S(M) is automagically imported into any such M*.

I can imagine another design where S(M) or a subset of S(M) must be explicitly imported into any M* using/importing M1 for M* to compile and function properly.

I imagine there are other treatments of this issue as well.

I also imagine there are discussions of (1) attempting to reduce the number of such dependencies between M* and S(M) via a module use/import and (2) perhaps more theoretical discussions about the relationships between modules that have or lack such dependencies (which I think will be very common minus efforts to prevent them.)

I would be very grateful for any pointers to the more or less accepted and received wisdom on these issues or to any particularly innovative or insightful treatment of these issues.

As always, mucho thanks in advance!

- Scott.