
On Sun, 2006-31-12 at 16:52 -0800, Iavor Diatchki wrote:
I also dislike Haskell code that contains LaTeX macros as it makes reading the comments more difficult (and I know both Haskell and LaTeX). Also converting the Haskell code to pdf is probably not a good option because you cannot use all the usual tools in your editor: I don't read code in the same way as I read a book.
The PDF isn't ideal, but it is better than what I've got now -- a PDF file would be readable, you see. Part of the problem with trying to read the .lhs files (the ones not marked with the simpler markup '>') is that the comments sections -- the part that's supposed to document the code to make it understandable -- seems to be threaded with macro substitution calls (or whatever it is called in latex). So I'll see something like this: In favour of omitting \tr{!B!}, \tr{!C!}: - {\em May} save a heap overflow test, if ...A... allocates anything. The other advantage of this is that we can use relative addressing from a single Hp to get at all the closures so allocated. Looking at this I'm seeing what appears to be some kind of latex variable name being expanded with what looks like a macro called "\tr". So what is this mysterious "B"? I have no idea. The code blocks both before and after this comment don't seem to show anything that this B-expansion would be turned into. At least if I could get the PDF output the macro expansion would be replaced with whatever name is in B's stead.
There are two ways to mark code. Using the one markup, code lines start with >.
This format I'm familiar with and can read readily. (I don't see the point of it -- what does this buy me that -{ }- blocks don't? -- but I can read it without too much difficulty.)
This is a comment again. The second way to mark code is to place it between \begin{code} and \end{code}. For example:
\begin{code} main = print "This is code" pi = 3.14 \end{code}
An here we have comments again.
This is the stuff that's hurting. The problem is that to my unschooled-in-Haskell eyes, the markup and the Haskell source blur together into a soup of executable line noise. The comments prove unhelpful because of the macro expansions I can't decode (like that "B" thing above) and the actual Haskell source can easily get lost in the mix. In the darcs source code, for example, there will be literally pages of comments (the user manual is part of the source code) with a little five-line block of code here, a ten-line block there. It's very easy to overlook the code in the sea of macro-expanded commentary. Being able to take the source and run it through something that formats the comments and the code differently and clearly (and expanding macros along the way) would render the whole thing far more readable (read: readable) even if I do lose the ability to easily navigate through the source to modify it for experiments, etc. The ideal world would be something that expands the latex code -- macro expansion in particular -- and strips the formatting code so that the code and the commentary are clearly separated but both are readable in a plain text editor. A good second place would be a way to actually take these .lhs files and make them PDFs (or DVIs or PSs or even HTMLs) so that at least the macros get expanded and the comments aren't interrupted by formatting code. A distant third place would be to strip the comments away and leave just the raw code behind -- but without the long, distracting gaps that unlit leaves. Now the distant third I can do thanks to the (excessively snarky IMO) comment Tony Finch left behind. I would like to know, however, if there is any way for me to get my second-place or even first-place options filled. Like a working command line for pdflatex? Or something better? And me? I'm going to use XML for literate Haskell. ;) -- Michael T. Richter Email: ttmrichter@gmail.com, mtr1966@hotpop.com MSN: ttmrichter@hotmail.com, mtr1966@hotmail.com; YIM: michael_richter_1966; AIM: YanJiahua1966; ICQ: 241960658; Jabber: mtr1966@jabber.cn "I have no purpose, directly or indirectly, to interfere with the institution of slavery in the States where it exists." --Abraham Lincoln