<div dir="ltr"><div><div><div>I originally kicked this off as an email to the maintainers of some of the other WAI web frameworks. After some initial brainstorming and some broad consensus to find some more shared common ground, we decided to open this up to a broader discussion.<br><br></div>I think the primary forum for this discussion will likely be the web-devel mailing list, though I'm cross-posting to haskell-wai and yesodweb as well for those interested. Please feel free to share with other mailing lists also. (We debated whether to use web-devel or haskell-wai for this discussion and didn't come to a decision, I'm fine moving it elsewhere.)<br><br></div>Based on the discussion, it seems like our best next step will be putting together a package containing some form of a Handler monad that could be shared by multiple web frameworks, hopefully making it easier to write code that can move between various frameworks. By contrast, we also seem to be in agreement that the high level routing code will end up being framework-specific, though we may be able to share some common low-level Trie-based dispatch code.<br><br></div>I'll leave it to other participants to restate points they made in the initial private discussion.<br><div><div><br>* * *<br><br><div dir="ltr"><div><div><div>Hi all,<br><br>When I was in San Francisco a
few months ago, Greg and I discussed the state of Haskell web
development. It's clear that there's a lot of great stuff going on. Both
of us have a strong desire to find as much common ground for all web
framework authors to work on as possible, without detracting from
meaningful distinctions between the various frameworks.<br><br>Greg
and I have discussed this point off and on for the past few months, and
haven't come up with very many concrete ideas. The recent work on
http-api-data[1] would be one possible example of collaboration. Other
possible ideas that Greg and I brainstormed were some kind of shared
library for efficient dispatch (that could be used under the surface for
the various high-level interface different libraries already provide),
or some kind of a common Handler-like monad (which from what I've seen
many people seem to reimplement all over the place). Some concrete benefits we can see from this:<br><br></div>* Previously, Persistent users were complaining that their types did not serialize in servant. http-api-data addresses this.<br></div>*
A common Handler would allow a higher layer abstraction for web apps,
much like WAI provides at a low level. With something like that, sharing
code like authentication logic becomes a reality<br></div>* We already
have precedence for other such shared libraries: client-session,
server-session, cookie, and authenticate, as a few examples.<br><div><div><div><div><br>These
are just ideas to kick off some thoughts, I'm sure some discussion could
bring out some better ideas. Overall, it seems like we have a lot of
opportunity to improve the situation for everyone if we focus on such
collaboration. Having a shared low-level HTTP interface (WAI) has
already helped this out considerably, I'm hoping there's something else
we can do in this vein as well.<br><br>Michael<br><br>[1] <a href="http://hackage.haskell.org/package/http-api-data" target="_blank">http://hackage.haskell.org/package/http-api-data</a></div></div></div></div></div><br></div></div></div>