patch applied (cabal): Fudge comment indentation in unliting to work with haddock

Duncan Coutts duncan.coutts at
Mon Feb 4 18:53:29 EST 2008

On Mon, 2008-02-04 at 21:37 +0000, Ian Lynagh wrote:

> Ah, I see. 
> A more-correct thing to do might be to indent to the same depth as the
> next token? That would have the additional advantage of being able to
> document nested functions.

True. I'm happy to see a patch like that. One way to do it might be to
groupBy the line kind. By walking over those blocks you'd might have
enough lookahead to see what the indent level should be.

> > code. So now we indent comments by two spaces instead. Obviously won't
> > work for code that's indented with ">" rather than "> ", so you can't
> > Haddock comment such code
> Not with literate comments, but you can if you use Haskell comments on
> birdtrack lines, presumably.

Sure, that's always worked because it gets unlited.

> In fact, I hadn't appreciated that non-Haskell comments would end up
> being picked up by haddock.

That's what this whole thing is about, allowing haddock markup in the
comment sections of .lhs files. eg:


More information about the cabal-devel mailing list