[Haskell-cafe] Project structure

John Lato jwlato at gmail.com
Thu Mar 3 13:07:42 CET 2011


>
> From: "Hauschild, Klaus (EXT)"
>
> 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?
>

I like the way the Snap-framework is organized:

./
./src/
./test/
./test/data/
./test/suite/
./snap-framework.cabal

Then if you have e.g.
./src/Snap/Types.hs

the tests go in
./tests/suite/Snap/Types/Tests.hs

Basically "src" is for all productive code, "test" is for tests of that
code.  I sometimes add these to the top level:
./tools
./resources

"tools" is for code generators or similar tools that auto-generate stuff to
go in ./src which cabal doesn't know about.  "resources" would be data
files, images, or similar resources that get bundled with the distribution.

John L.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110303/3652d2b0/attachment.htm>


More information about the Haskell-Cafe mailing list