GHC's CPP and Cabal's unlit

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Fri Jan 4 13:01:23 EST 2008


In message <20080104170826.GA7601 at matrix.chaos.earth.li> Duncan Coutts
<duncan.coutts at worc.ox.ac.uk>, Alistair Bayley <alistair at abayley.org>,
cabal-devel at haskell.org writes:

> > spot the difference? Yeah, just white space. The completely blank line
> > separates the paragraphs into two comments which haddock will treat
> > differently from a single comment.
> 
> I think both your examples should be treated the same, although I don't
> know whether they should be treated as one or two comments.

Alistair, can you remind us why we need the ability to break paragraphs into
multiple comments rather than a single comment? Or is it just that we need to be
able to have a comment followed by a blank line and then code. eg

blah blah

> some code

into

-- blah blah

some code

rather than:

-- blah blah
--
some code

is that all? I think that so long as we can avoid generating spurious
comment-next-to-code errors, the above distinction is irrelevant. We could avoid
comment next to code errors by using an extra comment/blank state for blank
lines trailing comments. They'd be transformed into comments but could
transition to > bird track lines without a code-next-to-comment error.

Perhaps I'll send a patch to implement that.
 
> Invisible whitespace is generally ignored elsewhere in Haskell, e.g.
> when determining if a literate comment is next to a bird track, or after
> a \ starting a string gap, the rationale being that if you can't see a
> difference then there shouldn't be one.

I agree, whatever distinction might be necessary it should not be done on the
basis of something that's invisible.

Duncan



More information about the cabal-devel mailing list