[m-users.] Creating an interface module

Volker Wysk post at volker-wysk.de
Fri Jul 14 18:02:06 AEST 2023


Am Freitag, dem 14.07.2023 um 17:41 +1000 schrieb Peter Wang:
> On Tue, 11 Jul 2023 16:59:42 +0200 Volker Wysk <post at volker-wysk.de> wrote:
> > Hi
> > 
> > In Haskell, you can import things into a first module from a second module
> > and reexport them from the first one. So you can use the first module as an
> > interface to things from several modules.
> > 
> > This doesn't seem to be possible in Mercury. You need to import all the
> > modules which contain parts of what you need. 
> > 
> > Submodules don't seem to be the answer.
> > 
> > Am I missing something? What is the recommended practice when you want to
> > split a library into several modules?
> 
> Mercury's module system is pretty basic and doesn't support
> re-exporting.

I can think of a solution that looks easy to implement. In a module there
could be some statement ":- import_as_well(...)", which tells the compiler
to import some other modules as well, when the module with the statement isĀ 
being imported.

Cheers,
Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.mercurylang.org/archives/users/attachments/20230714/b2f66570/attachment.sig>


More information about the users mailing list