GHC's CPP and Cabal's unlit

Duncan Coutts duncan.coutts at
Sat Feb 2 14:16:48 EST 2008

On Sat, 2008-02-02 at 02:47 +0000, Duncan Coutts wrote:

> So I downloaded takusen and tried this. Haddock does indeed barf. The
> problem is worse though because we do not know how much to indent by to
> fix things.

> I'm cc'ing David for his opinion on the matter.

So the problem is actually quite tricky. If we follow the unlit spec
then we must replace '>' by ' '. It is tempting to replace it by "" but
that is not enough, we would have to replace "> " by "" too and that is
definitely wrong because it would break code like this:

>topLevel = ...
> where ...

We'd end up breaking this code by unliting it to:

topLevel = ...
where ...

So I think we really have to follow the unlit spec. We are free to play
with the indenting of comments. We can assume that most bird track style
code uses "> " and most \being{code} style uses no indenting at all.

So that makes things tricky, we would have to indent comments by two
spaces before/after/near bird track code, and by none before/after/near
latex style code.

That seems possible if a bit unpleasant. Any better ideas?


More information about the cabal-devel mailing list