[Haskell-cafe] Project structure

wren ng thornton wren at freegeek.org
Fri Mar 4 06:22:04 CET 2011


On 3/3/11 3:33 AM, Hauschild, Klaus (EXT) wrote:
> Hi Haskellers,
>
> is there a recommended structure for Haskell projects. I like the Maven way (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html) for Java projects. How to separate productive from test code, how to separate source code from other resources?


My standard layout is:

     _darcs/
     LICENSE
     README
     TODO
     VERSION
     Setup.hs
     foo.cabal
     dist/
     src/
     test/

where _darcs is autogenerated by darcs, and dist is autogenerated by 
cabal-install. The README and TODO files are optional of course. The src 
and test directories contain parallel hierarchies of source code so that 
the src can be compiled and distributed without exposing dependencies on 
QuickCheck, SmallCheck, HUnit, etc.

If the project is multilanguage then I'll have ./src/hs/, ./src/c, 
./src/java, etc and the ./build.xml or whatever is standard for 
compiling the other languages plus a Makefile to run all the various 
build tools. Often this means adding ./bin, ./lib, ./doc, etc as the 
output destinations for those other tools.

-- 
Live well,
~wren



More information about the Haskell-Cafe mailing list