Export two modules from one.hs file?

Hey All, 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". Then I can use ModuleToUse everywhere else, and ModuleOpen in the UnitTests. I know I can declare ModuleOpen, and export only certain functions with ModuleToUse. But I am not sure, if that is a smart / normal thing to do. In my case this would double my modules, and ... hence files? What is the "real world" approach for this? Thanks Leonhard

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
participants (2)
-
Francesco Ariis
-
Leonhard Applis