[m-dev.] module system discussion

Peter Ross peter.ross at miscrit.be
Wed Dec 12 22:20:22 AEDT 2001

On Tue, Dec 11, 2001 at 12:47:26PM +1100, Fergus Henderson wrote:
> On 30-Nov-2001, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > 
> > I'm not proposing the `:- transparent_module' extension just
> > for .NET. I am arguing that it is generally good style to qualify
> > class method names with the class name, and that it is worth adding
> > a small extension to the module system to make that more convenient.
> > This hasn't come up before because we haven't used typeclasses much
> > before, and especially not in large module hierarchies.
> Wouldn't ordinary nested modules and `:- use_hierarchy' suffice,
> both for Mercury type classes, and for interfacing with .NET?
> What would `:- transparent_module' give us that ordinary nested
> modules and `:- use_hierarchy' don't?  Is whatever benefit they
> would give us really worth a language extension?

The transparent_module declaration places control of the importation of
the various sub-modules in the hands of the sub-module hierarchy
designer, the use_hierarchy in the hands of the user of the sub-module

It is useful to use transparent_module when the designer of a sub-module
hierarchy needs to place different sub-module qualifiers on items for
namespace reasons but the entities belong conceptually together.  This
happens for instance when modelling object oriented hierarchies using
type classes.

mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au

More information about the developers mailing list