Re: [m-users.] Creating an interface module
"Sean Charles (emacstheviking)" <[email protected]>
| Newsgroups | gmane.comp.lang.mercury.general |
|---|---|
| Message-ID | <[email protected]> |
What about :- publish_module foo. or :- export_module foo. This imports all the interface things from foo and literally re-exports them as though they were declared inline? > On 14 Jul 2023, at 09:02, Volker Wysk <[email protected]> wrote: > > Am Freitag, dem 14.07.2023 um 17:41 +1000 schrieb Peter Wang: >> On Tue, 11 Jul 2023 16:59:42 +0200 Volker Wysk <[email protected]> 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 > _______________________________________________ > users mailing list > [email protected] > https://lists.mercurylang.org/listinfo/users _______________________________________________ users mailing list [email protected] https://lists.mercurylang.org/listinfo/users