
Hi I want literate Haskell, but where the literate bit forming a document is actually HTML, not latex. Does anyone have any idea how to go about this? For a start, how do I persuade GHC to run the file: C:\Documents\Uni\tagsoup>runhaskell index.html Warning: ignoring unrecognised input `index.html' <interactive>:1:108: attempting to use module `Main' (Main.hs) which is not loaded And leading on to that, how Cabal might be used to compile the file. Secondly, what tricks can people think of for placing the code inside - I have come up with: <code>
foo = 1 </code>
And: <code> <!-- \begin{code} --> foo = 1 \end{code} </code> I can then hide the trailing \end{code} with a margin-bottm: -2em. Does anyone have any other ideas? Thanks Neil

On Dec 7, 2007, at 14:07 , Neil Mitchell wrote:
I want literate Haskell, but where the literate bit forming a document is actually HTML, not latex. Does anyone have any idea how to go about this?
You could replace the "unlit" executable in the GHC library directory with one which knows how to extract Haskell code from HTML. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

Hi Brandon,
You could replace the "unlit" executable in the GHC library directory with one which knows how to extract Haskell code from HTML.
I want a solution so that I can write the tagsoup manual in an way that can actually be run - I'd rather not force any additional dependence on a custom unlit command. However, adding HTML-style literate code to a future Haskell standard might not be a bad idea. Thanks Neil

On Dec 7, 2007, at 14:14 , Neil Mitchell wrote:
You could replace the "unlit" executable in the GHC library directory with one which knows how to extract Haskell code from HTML.
I want a solution so that I can write the tagsoup manual in an way that can actually be run - I'd rather not force any additional dependence on a custom unlit command. However, adding HTML-style literate code to a future Haskell standard might not be a bad idea.
I think HTML entities will cause problems with that, though. <pre> blocks *might* work to some extent, though. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

On Fri, 2007-12-07 at 19:14 +0000, Neil Mitchell wrote:
Hi Brandon,
You could replace the "unlit" executable in the GHC library directory with one which knows how to extract Haskell code from HTML.
I want a solution so that I can write the tagsoup manual in an way that can actually be run - I'd rather not force any additional dependence on a custom unlit command. However, adding HTML-style literate code to a future Haskell standard might not be a bad idea.
In the mean time you could prototype it as a pre-processor in Cabal if you write the unlit code. Duncan

On Fri, 7 Dec 2007, Neil Mitchell wrote:
Hi
I want literate Haskell, but where the literate bit forming a document is actually HTML, not latex. Does anyone have any idea how to go about this?
The numeric-quest library was the first and only one that I have seen in this style. I could only get it working both in GHC and a browser by creating links. Say Module.lhs Module.html -> Module.lhs http://darcs.haskell.org/numeric-quest/

Neil Mitchell wrote: ...
<code> <!-- \begin{code} --> foo = 1 \end{code} </code>
I can then hide the trailing \end{code} with a margin-bottm: -2em.
Does anyone have any other ideas?
I haven't thought this through, but maybe you could hide the trailing bit by : -- <!-- \end{code} --> Richard.

Hello, You can compile a .html file with: ghc --make -x lhs index.html if you write the code like this: <code>
foo = 1
</code>
N.B. You need an empty line between <code> and the code and one between
the code and </code>.
The -x flag doesn't seem to work for runhaskell, when I try this, I get
the message:
<interactive>:1:112:
attempting to use module `Main' (Main.hs) which is not loaded
Regards,
Henk-Jan
On Fri, 07 Dec 2007 20:07:41 +0100, Neil Mitchell
Hi
I want literate Haskell, but where the literate bit forming a document is actually HTML, not latex. Does anyone have any idea how to go about this?

Hi All, Thanks for the general help on literate HTML. It seems that using bird-tick style literate works better than \begin{code} style. I tried it with my document, but quickly gave up - mainly because I decided literateness did not fit with what I was doing.
You can compile a .html file with: ghc --make -x lhs index.html
You can also load it in GHCi with:
ghci -x lhs index.html
The -x flag doesn't seem to work for runhaskell
I couldn't get it working either, so have raised a feature request bug. Thanks for everyone's help, Neil

On 12/11/07, Neil Mitchell
I couldn't get it working either, so have raised a feature request bug.
Which has been merged into #1232: http://hackage.haskell.org/trac/ghc/ticket/1967#comment:1 -- vvv
participants (7)
-
Brandon S. Allbery KF8NH
-
Duncan Coutts
-
Henning Thielemann
-
hjgtuyl@chello.nl
-
Neil Mitchell
-
Richard Kelsall
-
Valery V. Vorotyntsev