[Haskell-cafe] Haskell and html input elements

Aaron Tomb atomb at soe.ucsc.edu
Mon Nov 12 12:13:57 EST 2007

On Nov 12, 2007, at 8:38 AM, PR Stanley wrote:

> Hi
> back again!
> How easy/hard is it to control a haskell program through a web  
> browser?


It depends on exactly how you want to control it, but at least some  
control is fairly easy.

If you simply want to start a batch Haskell program, and see its  
output as HTML in a browser, you can use the cgi [1] or fastcgi [2]  
libraries listed on Hackage.

If you want slightly more interactivity, it would make sense to write  
your Haskell program as its own web server (which is actually  
surprisingly easy) and have it respond to sequences of requests,  
perhaphs storing intermediate state along the way. Giving something  
like this a nice GUI on the user side will probably involve writing a  
certain amount of JavaScript. One example of a program that works  
this way is HERA [3], which is unfortunately not open-source at the  
moment, but may be some day. Another potentially useful library is  
HAppS [4], which abstracts out some of the functionality necessary  
for web-based applications.

Is this sort of thing along the right track, or were you thinking of  
something else?


[1] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/ 
[2] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/ 
[3] http://haskell.org/haskellwiki/ 
[4] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/ 

More information about the Haskell-Cafe mailing list