How should I name my Haskell modules for a program, not a library, and organize them in a hierarchy?
I'm making a ray tracer called Luminosity. First I had these modules:
Vector Colour Intersect Trace Render Parse Export
Each module was fine on it's own, but I felt like this lacked organization.
First, I put every module under Luminosity
, so for example Vector
was now Luminosity.Vector
(I assume this is standard for a haskell program?).
Then I thought: Vector and Colour are independent and could be reused, so they should be separated. But they're way too small to turn into libraries.
Where should they go? There is already (on hackage) a Data.Vector
and Data.Colour
, so should I put them there? Or will that cause confusion (even if I import them grouped with my other local imports)? If not there, should it be Luminosity.Data.Vector
or Data.Luminosity.Vector
? I'm pretty sure I've seen both used, although maybe I just happened to look at a project using a nonconventional structure.
I also have a simple TGA image exporter (Export
) which can be independent from Luminosity. It appears the correct location would be Codec.Image.TGA
, but again, should Luminosity
be in there somewhere and if so, where?
It would be nice if Structure of a Haskell project or some other wiki explained this.