[Haskell-cafe] [web-devel] Looking for criticism and comments on web-mongrel2.

Michael Snoyman michael at snoyman.com
Fri Jan 21 14:28:58 CET 2011


On Fri, Jan 21, 2011 at 2:30 PM, Clint Moore <cmoore at wamboli.com> wrote:
> After sufficient hand-wringing I finally uploaded web-mongrel2 up to
> hackage and I'm interested in criticism of my approach.  The module
> itself is terribly simple as it's meant to provide a lightweight layer
> between an application or framework and Mongrel2, but if nothing else,
> it's a start.
>
> Anyway, the hackage page is at
> http://hackage.haskell.org/package/web-mongrel2-0.0.2.2 with a link to
> the github repo.

Looks like you've done a good job so far, and have even put in a fair
amount of docs. Impressive! Just some minor thoughts:

* I think you should consider using ByteStrings instead of Strings in
a lot of places (eg, headers).
* In m2_parse, it looks to me like usage of Parsec is overkill, since
a simple break would work. As a plus, if you also switch to
ByteString, you could use breakByte which will give you a highly
optimized parsing function.
* For response_body, I'd **really** avoid usage of String. In fact,
some form of enumerator would be very good there. But at the very
least, please switch to a lazy ByteString.

I can't really say too much more without knowing more of the internals
of zeromq and mongrel2, but I think this is a good project to have
going for the Haskell community. Thank you.

Obviously I'm biased here, but I'd love to see a WAI wrapper for
mongrel2. Would you be interested in either having this package
provide a WAI interface, or writing a separate package that wraps this
package and provides one? I'd be happy to offer some help if you're
interested.

Michael



More information about the Haskell-Cafe mailing list