Hello, in the Haskell report the latex code environment is mentioned: http://www.haskell.org/onlinereport/literate.html Would it make sense, to add a xml like code environment as well, e.g., <code>...</code>? Ciao, Steffen
G'day all. Quoting Steffen Mazanek <steffen.mazanek@unibw-muenchen.de>:
Would it make sense, to add a xml like code environment as well, e.g., <code>...</code>?
It's hard to say. The problem is that some Haskell characters are also important for XML (e.g. <, &) and so you can't just cut and paste valid Haskell inside a <code>...</code> wrapper and expect it to work without some additional markup. You may be able to get away with putting your code in PIs like this: <?code main = putStrLn "Hello world!" ?> That, of course, is assuming that you want the XML processor to treat your code as a PI and not as CDATA. Was there something specific you wanted to do? Cheers, Andrew Bromage
begin ajb@spamcop.net quote:
Quoting Steffen Mazanek <steffen.mazanek@unibw-muenchen.de>:
Would it make sense, to add a xml like code environment as well, e.g., <code>...</code>?
It's hard to say. The problem is that some Haskell characters are also important for XML (e.g. <, &) and so you can't just cut and paste valid Haskell inside a <code>...</code> wrapper and expect it to work without some additional markup.
You could use a CDATA section: <code><[CDATA[ ...haskell code goes here... ]]></code> This way the only character sequence you have to avoid in the code is ]]>, which isn't really a restriction. Udo.
Hello, I have thought again about the relationship of Haskell and XML. Finally I come up with the following idea. Why not introduce a Haskell DTD? Not to gain better literate programming facilities, but to represent _real_ Haskell code in XML. Of course, no person would like to "program" Haskell in XML, but a uniform representation has its advantages nevertheless (cf. openmath [1]): * approved tools for further processing * separation of the presentation layer, pretty printing * interoperability * cross-linking (e.g., generating library summaries or in the manner of funnelweb [2], but xml-style) * objects are often serializable as xml, too The following questions are still open for me: * would the literate programming facilities really be improved? for now, Haskell plays nice with LaTeX, but not at all with XML * possible advantages of xml schema? What do you think about this? Do you see even more advantages of this approach or would it be senseless work? Regards, Steffen Mazanek [1] http://www.openmath.org/ [2] http://www.ross.net/funnelweb/
You could make a utility that just strips code out of XML, using the XML nesting as indentation for the Haskell code. Run it as a preprocessor. It's hard to get stuff like that standardized though. I imagine any kind of development environment is free to pretty up or package the source however it wants, so long as the compiler gets what it needs. The easiest way to make a standard is to make a tool that uses it. Personally I would prefer the kind of all-in-one package of code editor and XML packager/unpackager. That way it all gets done transparently, behind the scenes, and I never have to look at the mess. Personally, not a big fan of LaTeX. I don't understand the bias towards it. Sean ----- Original Message ----- From: "Steffen Mazanek" <steffen.mazanek@unibw-muenchen.de> To: <haskell@haskell.org> Sent: Monday, October 27, 2003 1:08 PM Subject: Re: literate comments
Hello,
I have thought again about the relationship of Haskell and XML. Finally I come up with the following idea. Why not introduce a Haskell DTD? Not to gain better literate programming facilities, but to represent _real_ Haskell code in XML. Of course, no person would like to "program" Haskell in XML, but a uniform representation has its advantages nevertheless (cf. openmath [1]):
* approved tools for further processing * separation of the presentation layer, pretty printing * interoperability * cross-linking (e.g., generating library summaries or in the manner of funnelweb [2], but xml-style) * objects are often serializable as xml, too
The following questions are still open for me:
* would the literate programming facilities really be improved? for now, Haskell plays nice with LaTeX, but not at all with XML * possible advantages of xml schema?
What do you think about this? Do you see even more advantages of this approach or would it be senseless work?
Regards, Steffen Mazanek
Hi, folks! Trying to build either 6.2 or 6.3 ghc with mingw gcc 3.3.1, I get multiple "undefined reference to `__module_registered' " errors during a stage2 ghc linking. Is the gcc 3.3 behaviour the case? Regards, Kyra
participants (5)
-
ajb@spamcop.net -
kyra -
Sean L. Palmer -
Steffen Mazanek -
Udo Stenzel