I’m working on a Haskell project and I started out by organizing it like this:
blah.hsholds the majority of the codeblah_main.hshas the main program- and
blah_test.hshas the test cases.
The problem with this is that restricting the functions exported by blah.hs means restricting the functions that can be tested from blah_test.hs. Is there a good way around this issue? Because I’d really like to write test code for some of the “internal” functions that aren’t being exported by blah.hs.
Thanks,
Lee
Move internal functions from the
Blah.*modules toBlah.Internal.*. You can hide internal modules from the users of your library by listing them in theother-modulesfield in theblah.cabalfile (instead ofexposed-modules, where you list all modules visible to the users). Look at Hakyll‘s .cabal file for an example.