Haddock code block problems

Adrian Hey ahey@iee.org
Sun, 4 May 2003 20:34:29 +0100


Hello

I'm using the latest Haddock release (0.4) and seem to
be having a lot of trouble getting line breaks to appear
in code blocks. I've tried it so many ways that if I
were to enumerate them all this would be a very long email.
I can't find any consistency in when it decides to work
(occasionally) and when it doesn't (usually). Here's
some examples..

This gives no line breaks:
{-$CStuff
@
test f []     = 0
test f (x:xs) = 0
@
-}

Neither does this:
{-$CStuff
>test f []     = 0
>test f (x:xs) = 0
-}

This gives a parse error:-(
{-$CStuff
@
test f []     = 0
test f (x:xs) = 0
@
>test f []     = 0
>test f (x:xs) = 0
-}

This doesn't, but still no line breaks.
{-$CStuff
>test f []     = 0
>test f (x:xs) = 0
@
test f []     = 0
test f (x:xs) = 0
@
-}

This gives me line breaks at the end of each birdtracked
line (only).
{-$CStuff
>test f []     = 0
>test f (x:xs) = 0

@
test f []     = 0
test f (x:xs) = 0
@
-}

But this gives me line breaks for both (as I would expect
from the Haddock docs):
{-$CStuff
@
test f []     = 0
test f (x:xs) = 0
@

>test f []     = 0
>test f (x:xs) = 0
-}

Strangely this works too (no parse error this time):
{-$CStuff
>test f []     = 0

>test f (x:xs) = 0
@
test f []     = 0
test f (x:xs) = 0
@
-}
 
So is this possibly a bug in Haddock?
Perhaps there's some syntactic requirement I'm failing
to observe?

Thanks
--
Adrian Hey