I fixed this. The problem was that we had pulled in files from elsewhere (the AFRP library), which were not written with haddock in mind. I was able to get haddock to work by escaping all occurrences of $'s and *'s that came after a dash. Too bad the error message is unrelated to the problem.


On Wed, Apr 21, 2010 at 6:30 PM, Ashish Agarwal <agarwal1975@gmail.com> wrote:
I've setup a cabal file for a project. Building works fine but cabal haddock gives the following error:

src/AFRP/AFRP.hs:1:0:
    File name does not match module name:
    Saw: `Main'
    Expected: `AFRP.AFRP'

However, the module name specified in AFRP.hs is in fact AFRP.AFRP so why is haddock seeing Main, especially since cabal build completes successfully?