
Dennis Raddle
I have a few basic questions about my project organization using stack.
I'm going to have several executables and a hierarchical library.
For instance, let's say I'm going to call my overall system "cac" (computer aided composition). I'll have imports like
import Cac.Util import Cac.Search import Cac.Search.Algo1 -- some modules that assist things import XDoc import XDoc.Parse
and so on.
I'll have executables named 'foo', 'bar', etc.
So would the following be correct?
- call the directory where I put all stack packages $PROJ
- call the top level of my specific project $PROJ/cac, which will have $PROJ/cac/cac.cabal
- I'll have the following files and dirs:
- modules:
- $PROJ/cac/src/Cac.hs - $PROJ/cac/src/Cac/ - $PROJ/cac/src/Cac/Util.hs - $PROJ/cac/src/Cac/Search.hs - $PROJ/cac/src/Cac/Search/ - $PROJ/cac/src/XDoc.hs - $PROJ/cac/src/XDoc/ - $PROJ/cac/src/XDoc/Parse.hs
- executables:
- $PROJ/app/foo.hs - $PROJ/app/bar.hs
Also, if I'm going to use git, would my .git/ directory be at $PROJ/cac/.git/ ?
Depending a little on how tightly coupled lib and exes are I'd either put all into a single Cabal file: cac/ .git/... cac.cabal stack.yaml src/ Cac.hs Cac/ Util.hs ... app/ foo.hs bar.hs Or lib and exes in separate folders: $PROJ/ .git/... stack.yaml cac/ cac.cabal src/ Cac.hs Cac/ Util.hs ... app/ app.cabal foo.hs bar.hs Or maybe even each exe into its own folder. /M -- Magnus Therning OpenPGP: 0x927912051716CE39 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus Computer Science: "In low-level languages like C" Computer Engineering: "In high-level languages like C"