[Haskell-beginners] Export two modules from one.hs file?

Francesco Ariis fa-ml at ariis.it
Mon Nov 18 22:23:52 UTC 2019


Hello Leonard,

On Mon, Nov 18, 2019 at 08:42:22PM +0000, Leonhard Applis wrote:
> I currently want to make a module, which "truly" exposes 3 functions.
> However, there are more functions which I want to test.
> I would like to export two modules from the same file, "ModuleToUse"
> and "ModuleOpen".

Unfortunately Haskell (rather, GHC) in its current incarnation does
not allow many-modules-per-single-file (which would indeed come quite
handy in cases like yours, in writing example code, etc.).

> What is the "real world" approach for this?

Have two modules, `Prova` and `Prova.Internal` (files:
`src/Prova.hs` and `src/Prova/Intenral.hs`).j

Does this answer your question?
-F


More information about the Beginners mailing list