|
Showing Haskell: msg#00094lang.haskell.general
Hi all, I just send this message to share some Haskell code with you. I hope it might be useful to some people. (Maybe even to the haskell.org crowd!) Recently I experimented a little bit with an easy way of writing CGI scripts that generate HTML in Haskell. I know many people have done this already, but I was inspired by the paper "Haskell Server Pages" by Erik Meijer et al., which uses an HTML datatype where one can also do IO inside. This makes it a lot more convenient to write CGI scripts I think. The idea is to have an HTML datatype of the following kind: type Html = [HtmlEl] data HtmlEl = Text String | Tag String [(String,String)] Html | Action (IO Html) I wrote a very modest CGI library making use of this datatype, and also providing some other useful functions for writing CGI scripts (such as locked variables). I also implemented some CGI scripts of course. One script is a script that "shows" a Haskell module, using syntax highlighting. One can also click on imported modules and see their definitions. To see the Haskell CGI library displyed by this CGI script, go to the following link: http://www.cs.chalmers.se/Cs/Grundutb/Kurser/afp/Cgi/show-haskell.cgi?file=Cgi.hs&title=Module+Cgi (I used it in my course, so there is some extra junk there.) You can click on the bottom of the page, and look at the implementation of the "show-haskell" script. Regards, Koen. -- Koen Claessen http://www.cs.chalmers.se/~koen phone:+46-31-772 5424 mailto:koen@xxxxxxxxxxxxxx ----------------------------------------------------- Chalmers University of Technology, Gothenburg, Sweden |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | MBR'01 Deadline extension: 00094, Lorenzo Magnani |
|---|---|
| Next by Date: | Re: "Green Card" for untyped lambda calculus?: 00094, C.Reinke |
| Previous by Thread: | WoLLIC'2001 - Call for Papersi: 00094, Ruy de Queiroz |
| Next by Thread: | Release 2: Mondrian and Haskell for .NET: 00094, Nigel Perry |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |