My reference is alway Structure of a Haskell project and How to write a Haskell program which spell out some defaults which the community more or less seems to follow. It has worked well for me so far but my projects have not been very large as of yet.
What is suggested in Structure of a Haskell project sounds similar to what you have outlined in your post with a few minor modifications like the testing folder is in the same directory as the src folder.
Edit:
cabal init
will generate a minimal amount for you including the cabal file with relevant dependencies if you have a any files with imports at least. It is a great start but only part of what you are looking for.
Ideally as a project grows the cabal file and directory hierarchy would be automatically kept up to date, I am unaware of any tool made public that will do this though. It is on my maybe one day list as I am sure it s for many others.
-odir
and -hidir
can be used with ghc to put the *.o and *.hi files in separate directories. You can read more in GHC user guide’s section on separate compilation)
Edit2:
Other relevant/overlapping posts:
- Basic Structure of a Haskell Program
- Haskell module naming conventions
- Large-scale design in Haskell?