The HTTP protocol was designed to transfer static contents. However, in real-world applications, dynamic contents is often needed. In the past, increasingly better abstractions over the HTTP protocol have been designed to allow for this.
In my thesis, we propose a Haskell DSEL called WebFunctions, that:
allows for loose coupling between model, view and controller code
manages session state and application state automatically and transparently for the programmer
runs an entire web application within one process
allows for reuse
implicitly handles database interaction
guarantees correctness of generated HTML and SQL code