Haddock 2.0.0.0 Bug: Doesn't Like {;}-Style Code

View: New views
2 Messages — Rating Filter:   Alert me  

Haddock 2.0.0.0 Bug: Doesn't Like {;}-Style Code

by Ashley Yakeley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Try running haddock on this:

module HaddockBug where
{
-- |The 'square' function squares an integer.
square :: Int -> Int;
square x = x * x;
}

$ haddock -B /usr/lib/ghc-6.8.2/ HaddockBug.hs

HaddockBug.hs:4:0: parse error on input `square'
haddock: Failed to load all needed modules

It works fine if you remove the haddock comment...

--
Ashley Yakeley
Seattle, WA

_______________________________________________
HaskellDoc mailing list
HaskellDoc@...
http://www.haskell.org/mailman/listinfo/haskelldoc

Parent Message unknown Re: Haddock 2.0.0.0 Bug: Doesn't Like {;}-Style Code

by David Waern :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I wrote:
>> Try running haddock on this:
>>
>> module HaddockBug where
>> {
>> -- |The 'square' function squares an integer.
>> square :: Int -> Int;
>> square x = x * x;
>> }
>>
>> $ haddock -B /usr/lib/ghc-6.8.2/ HaddockBug.hs
>>
>> HaddockBug.hs:4:0: parse error on input `square'
>> haddock: Failed to load all needed modules
>>
>> It works fine if you remove the haddock comment...
>
> I discovered a work-around: put a semicolon after the haddock comment.
>
> module HaddockBug where
> {
> -- |The 'square' function squares an integer.
> ;
> square :: Int -> Int;
> square x = x * x;
> }
>
> --
> Ashley Yakeley
> Seattle, WA
>


Thanks for the report. This is a known bug though, and it's due to the
fact that Haddock comments are handled just like any other declaration in
the GHC grammar. This should be changed, so that the placement of Haddock
comments doesn't depend on layout, but I never got around to fix it during
the Summer of Code project. I will update the TODO file to include this
bug.

David

_______________________________________________
HaskellDoc mailing list
HaskellDoc@...
http://www.haskell.org/mailman/listinfo/haskelldoc
LightInTheBox - Buy quality products at wholesale price