[Haskell-cafe] Web application interface

Michael Snoyman michael at snoyman.com
Wed Jan 13 09:46:12 EST 2010


I recently read (again) the wiki page on a web application interface[1] for
Haskell. It seems like this basically works out to Hack[2], but using an
enumerator instead of lazy bytestring in the response type. Is anyone
working on implementing this? If not, I would like to create the package,
though I wouldn't mind some community input on some design decisions:

* Hack has been fairly well-tested in the past year and I think it provides
the features that people want. Therefore, I would want to model the
Environment variable for WAI from Hack. I *could* just import Hack in WAI
and use the exact same Environment data type. Thoughts?

* If using a different data type for Environment, should I replace the
String parts with ByteStrings? On the one hand, ByteStrings are the
"correct" data type since the HTTP protocol does not specify a character
encoding; on the other hand, Strings are easier to deal with.

* It's simple to write a function to convert between a lazy bytestring and
an enumerator, meaning it would be very easy to write conversion functions
between Hack and WAI applications. This would make it simpler for people to
use either backend.

If someone else is already working on WAI, please let me know, I don't want
to have duplicate implementations. The idea here is to consolidate, not
split the community. I have a few Hack handlers (simpleserver, cgi, fastcgi)
that I would happily convert to WAI handlers as well.


[1] http://www.haskell.org/haskellwiki/WebApplicationInterface
[2] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hack
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100113/7309a790/attachment.html

More information about the Haskell-Cafe mailing list