A Simple Haskell Web Server

February 14, 2008

I am always interested in web development as that is the industry I work in. As I also have an interest in Haskell I decided to try out using Haskell for web development.

There are some innovative web frameworks developed in Haskell, such as HAppS and WASH. There are also simpler approachs such as CGI and FastCGI libraries. I decided to develop my own simple web server and framework as I was interested in how Haskell would fare with more conventional and simpler HTML and database backed web sites, but was after more flexibility to experiment than CGI based approaches can provide.

What I’ve ended up with is not production quality by any means, but it provides a good and simple base to experiment and work from. Thanks to the HTTP and network libraries it worked out to around 20 lines of code. Below I present the primitive interface of the web server and its implmentation.

Read the rest of this entry »