I’m a little dissatisfied with the libraries available for authoring web pages in Haskell. I want something that takes full advantage of Haskell’s do-notation to produce simple, readable code. Something like this:
main = httpServe 8080 $ do GET "/hello" ==> index index :: Reader HttpRequest (HttpResponse -> IO HttpResponse) index = do name <- param "name" setHeader "Content-Type" "text/plain" output "Hello " output name
I’m still a way from finishing it, but I’ve managed to create a HTTP request parser and a basic server. I’m aiming for a initial 0.0.1 release that will allow me to specify fixed outputs for any valid HTTP request:
main = httpServe 8080 (output "Hello World")
From there, I hope to add features with each release, until I have something usable. The code will be available under a MIT license.