# hat-trans reference guide

hat-trans is a stand-alone program that performs a source-to-source transformation on a single Haskell module, such that the functions in the transformed module deposit traces in a .hat file in addition to computing their original results.

The transformed module is written to a file of the same name as the original, but in a directory called `Hat`. If the directory does not exist, hat-trans creates it. If the module is part of the hierarchical namespace, then a single `Hat` directory is created at the root of the tree, and it is populated with new directories corresponding to the remainder of the hierarchy. For instance, a module called `A.B.C`, in a file named `A/B/C.hs`, is transformed by hat-trans into a module called `Hat.A.B.C`, stored in a file named `Hat/A/B/C.hs`.

File arguments.

.hs | Haskell source file
.lhs | literate Haskell source file

Flags.

-Idir | search directory dir for imported modules during transformation. (hat-trans actually looks for the .hx file generated by a prior invocation of hat-trans, rather than the source module itself.)
-Pdir | search directory dir for prelude and stdlib modules during transformation
+RTS | the following options (up to -RTS) should be passed only to hat-trans's runtime system (for instance to increase its heap size for processing a large file)

Options to change the usual transformation behaviour.

-unix | Use unix filenames (default)
-nounix | Use RiscOS filenames
-unlit | Unliterate the source code
-nounlit | Do not unliterate the source code (default)
-underscore | Treat underscores strictly as lowercase (default)
-nounderscore | Treat underscores as invisible, e.g. _f is varid, _F is conid
-prelude | Treat prelude definitions specially
-noprelude | Do not treat definitions specially (default)
-trusted | make this a "trusted" module
-notrusted | make this an "untrusted" module (default)

Options to examine the internal progress of the transformation.

-showwidth=w | set width in characters of output of an intermediate syntax tree to w (default=80)
-showindent=i | set indentation in characters for nesting of output of an intermediate syntax tree to i (default=2)
-showqualified | use qualified names in output of intermediate syntax tree (default=on)
-lex | show lexical input
-parse | show syntax tree after parser
-tracefns | show syntax tree after tracing translation

This page last updated: 5th February 2003