
I would like to conditionally expose a number of internal modules in a
library depending on a cabal flag - the idea is that new features
could be implemented externally to the library without contaminating
the source with undesirable changes. However, I've been unable to
find a way to structure a cabal file that does not require repeating
the list of modules. For example, this works:
exposed-modules:
Public.Stable.Module
if flag(exposeInternals)
exposed-modules:
<long list of internal modules>
else
other-modules: