Don't store the cabal sandbox or the cabal build directory in the working directory.
Reading code. Looks like Haddock doesn't even know where the input files are, it just generates links based on module/line/col.
Generate filenames from the module name and use that if it exists.