You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is bad practice as if an exe component depends on a lib component, GHC will recompile the modules, and not use the compiled library: double compilation of same modules.
An alternative is to implement a "don't compile modules we didn't told you to" to GHC, but I think this small step is still a good engineering practice, even cabal could tell (future) GHC to be less smart.
So, if the person running the program so desires, they could specify a distinct directory for the
executable code such as app. The default is none, which is the project root directory. (Though the test suite does get placed to a subdirectory by default.) If all defaults are
accepted, the file hierarchy looks like this:
Also, the most recent version of cabal-install allows you to configure this in your ~/.cabal/config file. There is a new init subsection where you can set the default source-dir and application-dir, among others:
Circling back to this, given that this is configurable we should be able to avoid too much bikeshedding on whether we use lib or src for source-dir since folks can set the default to whatever they'd prefer.
I'll put together a PR changing the defaults for source-dir to lib/ and application-dir to app/.
This is bad practice as if an exe component depends on a lib component, GHC will recompile the modules, and not use the compiled library: double compilation of same modules.
An alternative is to implement a "don't compile modules we didn't told you to" to GHC, but I think this small step is still a good engineering practice, even
cabal
could tell (future) GHC to be less smart.See #6143 (comment)
The text was updated successfully, but these errors were encountered: