yesodweb/wai — pull request #230 by alevy (2014-03-04 20:01:43+00:00)
Title: Parameterize monad for Request/Response

_NOTE: I'm not expecting this pull request to be merged as is, just testing the waters for whether a more robust change like this would be well received_

Instead of Request & Response having the IO monad baked in (in
requestBody and ResponseSource, respectively), add a type parameter.
Most of the IO dependent code is in the server or application itself.
Parameterizing would allow applications and servers to run in different,
IO-like Monads (STM, StateT IO, LIO, etc) while sharing a lot of
functionality with wai-based libraries (e.g. parameter parsing).

We're working on something like this already for the LIO monad, which is basically a security monad where IO-like operations are checked against a security policy defined by information flow control rules -- like SELinux but way less sucky (we hope). Right now we're baking integration into a framework built on top of WAI ([Simple](http://hackage.haskell.org/package/simple], shameless plug), but we're needing to parameterize basically everything (including the request and response types). It would be **awesome** if we could instead leverage the wealth of functionality either baked into WAI or in libraries dependent on it!