[Hat] Proposal, Heirarchical module structure for tools

Neil Mitchell ndmitchell at gmail.com
Sat Oct 7 10:06:59 EDT 2006


Hi,

The current hattools directory has 38 Haskell files in it, and 34
.h/.c files. It would be nice if these were split so it was easy to
determine the files in one program, and what is a tool versus what is
a library.

The following is a draft proposal:

Hat - global module in which all Hat stuff resides

(this clashes with the hat-trans output, does this matter?)

Hat.Lib - directory for libraries, which export a nice API for using
in the tools - for example HatCover as Hat.Lib.Cover.

Hat.Tool - directory for the tools, for example HatCoverText, as Hat.Tool.Cover

Hat.Common - Common functions which are unrelated to Hat tracing, but
are used by the Tools, for example HighlightStyle as
Hat.Common.HighlightStyle

Within Hat.Tool, I would expect some simpler (one module) tools to be
Hat.Tool.ToolName, but more complex tools would be
Hat.Tool.ToolName.Modules, with a single Hat.Tool.ToolName module
which imports the others.

To keep the structure of having a Main module at the root which is the
tool for each given tool, for each tool a file would be created:

-- file HatCover.hs
import Hat.Tool.Cover

This file gives an easy module Main to be located for each tool.

The advantages of this scheme:
* Easier to differentiate between libraries and tools
* Easier to find a particular tool and all its given code
* Clearer separation of Hat code vs general Haskell

Thanks

Neil


More information about the Hat mailing list