it seems that symbols like \ and ' are gone form the generated documentation

Code in the source of a package like: @ *Main> throw ThisException `catch` \e -> putStrLn (\"Caught \" ++ show (e :: MyException)) Caught ThisException @ (from the module http://haskell.org/ghc/docs/7.0-latest/html/libraries/base-4.3.0.0/src/GHC-E...) gets formatted like: *Main> throw ThisException catch e -> putStrLn ("Caught " ++ show (e :: MyException)) Caught ThisException where the underlying HTML is: </p><pre> *Main> throw ThisException <code>catch</code> e -> putStrLn ("Caught " ++ show (e :: MyException)) Caught ThisException </pre><p> This is a Haddock problem I assume? Doaitse

2010/12/9 S. Doaitse Swierstra
Code in the source of a package like:
@ *Main> throw ThisException `catch` \e -> putStrLn (\"Caught \" ++ show (e :: MyException)) Caught ThisException @
(from the module http://haskell.org/ghc/docs/7.0-latest/html/libraries/base-4.3.0.0/src/GHC-E...) gets formatted like:
*Main> throw ThisException catch e -> putStrLn ("Caught " ++ show (e :: MyException)) Caught ThisException
where the underlying HTML is:
</p><pre> *Main> throw ThisException <code>catch</code> e -> putStrLn ("Caught " ++ show (e :: MyException)) Caught ThisException </pre><p>
This is a Haddock problem I assume? Doaitse
Most probably yes. Here's the code for those who want to take a look: http://code.haskell.org/haddock/src/Haddock/Lex.x I'll take a look at it later. David

On Thu, 2010-12-09 at 00:16 +0100, S. Doaitse Swierstra wrote:
Code in the source of a package like: @ *Main> throw ThisException `catch` \e -> putStrLn (\"Caught \" ++ show (e :: MyException)) Caught ThisException @ gets formatted like: *Main> throw ThisException catch e -> putStrLn ("Caught " ++ show (e :: MyException)) Caught ThisException
From http://www.haskell.org/haddock/doc/html/ch03s08.html#id565903
3.8.2. Special characters The following characters have special meanings in documentation comments: /, ', `, ", @, <. To insert a literal occurrence of one of these special characters, precede it with a backslash (\). Maybe this is also necessary inside code blocks in documentation comments. I think \ should be added to the list of special characters as it also has special meaning. Sebastian

Hi!
On Thu, Dec 9, 2010 at 3:03 PM, Sebastian Fischer
Maybe this is also necessary inside code blocks in documentation comments.
There are two types of code blocks. Those with @ where you have to escape and those with > where you do not have to escape. So changing to > in this documentation case would solve the problem, probably. Mitar

2010/12/9 Mitar
Hi!
On Thu, Dec 9, 2010 at 3:03 PM, Sebastian Fischer
wrote: Maybe this is also necessary inside code blocks in documentation comments.
There are two types of code blocks. Those with @ where you have to escape and those with > where you do not have to escape. So changing to > in this documentation case would solve the problem, probably.
Ah, yes that is indeed correct, and also described in the manual. @ ... @ is markup for monospaced text where you can still use normal Hadock markup to get e.g. hyperlinked identifiers and whatnot. That's why `catch` gets wrapped in a <code> tag -- <code> is how me markup identifiers. David

On 12/09/10 13:36, David Waern wrote:
2010/12/9 Mitar
: Hi!
On Thu, Dec 9, 2010 at 3:03 PM, Sebastian Fischer
wrote: Maybe this is also necessary inside code blocks in documentation comments.
There are two types of code blocks. Those with @ where you have to escape and those with> where you do not have to escape. So changing to> in this documentation case would solve the problem, probably.
Ah, yes that is indeed correct, and also described in the manual. @ ... @ is markup for monospaced text where you can still use normal Hadock markup to get e.g. hyperlinked identifiers and whatnot.
That's why `catch` gets wrapped in a<code> tag --<code> is how me markup identifiers.
We could warn for `...` being <code> markup. The Haddock-user can use one or both ' quote marks instead. This mistake is made in Haddock documentation all over the place, because `...` has a common meaning in Haskell of infix, and the resulting documentation looks only moderately wrong. -Isaac
participants (5)
-
David Waern
-
Isaac Dupree
-
Mitar
-
S. Doaitse Swierstra
-
Sebastian Fischer