darcs

Issue 935 make api-doc with haddock 2.1.0 fails due to comment misformatting

Title make api-doc with haddock 2.1.0 fails due to comment misformatting
Priority bug Status resolved
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, gwern, kowey, mikedlr, thorkilnaur, tommy
Assigned To
Topics

Created on 2008-06-22.12:08:40 by mikedlr, last changed 2009-08-27.14:01:02 by admin.

Messages
msg5132 (view) Author: mikedlr Date: 2008-06-22.12:08:37
With the latest darcs from the source repository and a custom built haddock
2.1.0 I get the following error when trying to do make api-doc

src/DateMatcher.lhs:85:10: parse error on input `('
haddock: Failed to check module: DateMatcher
make: *** [api-doc] Error 1

I look at the appropriate line and it appears to be formatted to be interpreted
by haddock as a parameter declaration but I guess haddock doesn't understand the
type.  

The following patch 

hunk ./src/DateMatcher.lhs 84
        calB   = resetCalendar b_
 
 data DateMatcher = forall d . (Show d) =>
-       DM String -- ^ name
-          (Either ParseError d) -- ^ parser
-          (d -> CalendarTime -> Bool) -- ^ matcher
+       DM String --  name
+          (Either ParseError d) --  parser
+          (d -> CalendarTime -> Bool) --  matcher
 
 parseDateMatcher :: String -> IO (CalendarTime -> Bool)
 parseDateMatcher d = $

gets rid of the problem by making the comments not interpreted by haddock (full
"darcs send" version attached to this bug) but I'm not sure that's the right
thing to do at all.
Attachments
msg5133 (view) Author: gwern Date: 2008-06-22.13:36:37
This strikes me as probably a Haddock regression. Haddock seems to be fairly
buggy w/r/t to those parameter declarations - Haddock 2.0, for example, had a
very similar regression but in 2.0 the problem was with 'type' declarations!
(Not 'data'.) Have you asked David Waern about this?
msg5134 (view) Author: mikedlr Date: 2008-06-22.16:13:44
I have asked David Waern now.  I sent him a link to thus bug so hopefully he'll
come by and comment further.  In the meantime I'll likely try with an earlier
verison of haddock and see if it makes a difference.
msg5135 (view) Author: mikedlr Date: 2008-06-22.16:29:58
I wonder if this isn't the issue.

http://groups.google.co.uk/group/fa.haskell/browse_thread/thread/520a9a5172afa30d
msg5136 (view) Author: mikedlr Date: 2008-06-22.18:04:44
David has responded: 

The problem is that Haddock does not support doc comments on
constructor arguments. Ideally, Haddock should emit a warning when
encountering misplaced doc comments, but currently it doesn't. Doing
this would require some re-thinking of how to parse the doc comments.
They are currently parsed with the GHC parser, and it treats them just
like any other language syntax, when the -haddock flag is set.

I guess that something like my patch should be accepted until this is later
supported by haddock?
msg5147 (view) Author: kowey Date: 2008-06-27.09:37:14
Resolved by

Sun Jun 22 19:26:44 BST 2008  Michael De La Rue
<gneqbgqnepfqbgarg.yeuhc@spamgourmet.com>
  * Delete haddock documentation on constructor arguments; see Issue935

Thanks!

(by the way, Mike, you may be interested to know that you can prefix future
patches to darcs with stuff 'resolve issueXXX:' which is then noticed by our
bugtracker)
History
Date User Action Args
2008-06-22 12:08:40mikedlrcreate
2008-06-22 13:36:40gwernsetstatus: unread -> unknown
nosy: + gwern
messages: + msg5133
2008-06-22 16:13:46mikedlrsetnosy: tommy, beschmi, dagit, gwern, mikedlr
messages: + msg5134
2008-06-22 16:30:00mikedlrsetstatus: unknown -> (no value)
nosy: tommy, beschmi, dagit, gwern, mikedlr
messages: + msg5135
2008-06-22 18:04:47mikedlrsetstatus: unknown
nosy: tommy, beschmi, dagit, gwern, mikedlr
messages: + msg5136
2008-06-22 18:29:31mikedlrsetfiles: - darcs-haddock-hack.patch
nosy: tommy, beschmi, dagit, gwern, mikedlr
2008-06-27 09:37:17koweysetstatus: unknown -> resolved
nosy: + kowey
messages: + msg5147
2009-08-06 21:08:35adminsetnosy: + dmitry.kurochkin, simon, thorkilnaur, - beschmi
2009-08-11 00:17:43adminsetnosy: - dagit
2009-08-25 18:12:49adminsetnosy: + darcs-devel, - simon
2009-08-27 14:01:02adminsetnosy: tommy, kowey, darcs-devel, thorkilnaur, gwern, dmitry.kurochkin, mikedlr