
"Alistair Bayley"
It uses -cpp if CPP is in the language extensions in the .cabal file.
So it does. So now Haddock completes, but produces very limited output.
Perhaps unlitting should be done by converting all literate comments into {- ... -} style comments.
I have a programme (FishFeeder) that does this; it's a bit hacky, but I could post it here if someone was interested in taking it on.
As I alluded to earlier, I have a program which I wrote to do this. It prefixes "--" rather than enclosing in {- -},
Mine uses {- -} and escapes any such present in comments. Here is the first comment from the source, which is itself literate haddock: | Preprocess literate haskell with Haddockumentation in the literate comments for use with Haddock. So making things a bit prettier Assumes that there is at least one space after every \">\", and indents the \"{-\"s (but not the \"-}\"s) by that much so that Haddock doesn't give a parse error. This is a bit of a hack, but I reckon it's haddock's fault since comments shouldn't have any effect on layout.
and it's not perfect
I'd very be surprised if mine were!
(there are a number of cases it doesn't handle, although I'm of the opinion that you shouldn't be doing whatever it fails on). I'm thinking it might be feasible to distribute this in the Takusen release and hook it into the cabal "setup haddock" command to preprocess the .lhs files.
It would surely be better to distribute a tool (either with compilers or with haddock) so that it worked for anyone who likes literate haskell?
I have been tempted to run it over our .lhs once and for all, and convert everything to regular .hs files, but Oleg seems to like the birdtrack style, so we've decided to stick with it for now.
I much prefer the birdtrack style; it's a matter of taste, and there's nothing more likely to cause disaffection than insisting that someone abide by someone else's taste. I would hate to see it deprecated just because the tools were no good. -- Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk

On Thu, 2007-08-02 at 15:41 +0100, Jon Fairbairn wrote:
"Alistair Bayley"
writes: It uses -cpp if CPP is in the language extensions in the .cabal file.
So it does. So now Haddock completes, but produces very limited output.
Perhaps unlitting should be done by converting all literate comments into {- ... -} style comments.
I have a programme (FishFeeder) that does this; it's a bit hacky, but I could post it here if someone was interested in taking it on.
Sure why not. Post it. As I say, we've already got unlit code in Cabal. If anyone wants to then make a patch to Cabal's unlit code that'd be much appreciated. Then we can ask Alistair to use Takusen as a test case. Or we could see about getting it into cpphs's --unlit mode. Duncan

Duncan Coutts
On Thu, 2007-08-02 at 15:41 +0100, Jon Fairbairn wrote:
"Alistair Bayley"
writes: It uses -cpp if CPP is in the language extensions in the .cabal file.
So it does. So now Haddock completes, but produces very limited output.
Perhaps unlitting should be done by converting all literate comments into {- ... -} style comments.
I have a programme (FishFeeder) that does this; it's a bit hacky, but I could post it here if someone was interested in taking it on.
Sure why not. Post it. As I say, we've already got unlit code in Cabal.
OK, but as I said, it's hacky... -- Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk
participants (2)
-
Duncan Coutts
-
Jon Fairbairn