GHC's CPP and Cabal's unlit

Jon Fairbairn jon.fairbairn at cl.cam.ac.uk
Thu Jan 31 11:20:49 EST 2008


Duncan Coutts <duncan.coutts at worc.ox.ac.uk> writes:

> On Thu, 2008-01-10 at 14:25 +0000, Alistair Bayley wrote:
>
>> the comment block (like cabal does)
>>  - don't indent code relative to comments, because Haddock doesn't like this
>
> Hmm, we will have to find another solution to this because the H98 unlit
> spec clearly states that '>' is to be replaced with a ' ', not just
> deleted. So if haddock barfs on code like:
>
> -- a comment
>
>  some code
>
> then either we should fix haddock, or perhaps indent the comments too,
> eg:
>
>  -- the comment
>
>  the code
>
> Since we expect to use this unlit code more generally in future we do
> need to make sure it is a compatible extension of the H98 unlit spec.

I haven't looked at this in a while, but I reckon that
Haddock does the wrong thing wrt layout -- in my hacked-up
unlit I replace leading ">" with " " and assume that all
code lines have at least one space after the ">", so use
"  {-" on the blank line separating code from comment and just 
"-}" on the line between comment and code.  This was all to 
stop haddock giving parse errors in what looked like reasonable
layouts.

Even using illiterate Haskell I find haddock (at least up to
0.8) to be unreasonable picky about indentation of comments,
so I think that's where the change should be made.

-- 
Jón Fairbairn                                 Jon.Fairbairn at cl.cam.ac.uk



More information about the cabal-devel mailing list