[web-devel] Hoogle Advice

Michael Snoyman michael at snoyman.com
Sun Jan 23 21:36:50 CET 2011

On Sun, Jan 23, 2011 at 9:38 PM, Neil Mitchell <ndmitchell at gmail.com> wrote:
> Hi Michael,
> Thanks for the information.
>> Essentailly, in a reverse HTTP, you'll have a standalone server
>> running on some port that never talks to the outside world, and Apache
>> will proxy all HTTP connections for your application to that server.
> I hadn't heard of Reverse HTTP proxy before, but it seems to be the
> simplest option for me - as I'll want Hoogle to be able to run as a
> web server anyway. Taking a look it seems easy enough to configure in
> Apache, so seems the perfect answer.
>> There are at this point three main web frameworks in Haskell (that I'm
>> aware of, someone correct me if I'm wrong): Yesod[1], Happstack[2] and
>> Snap[3].
> I've seen and looked at all the three main options. The one that
> seemed to appeal to me most was Wai+Warp - does that count as Yesod?

No, it's different than Yesod, but you could say it's in the same
family. Yesod is built on top of WAI, and so in theory Hoogle would
have the ability to integrate very easily with Yesod applications.
(This is actually a feature I'm working on right now for Yesod 0.7.)
If you don't need the extra features of Yesod, I think WAI is a good
choice for a target.

> One question on Wai - I see version 0.3.0 says "For that reason, this
> library includes Network.Wai.Enumerator" - but the .cabal file doesn't
> mention that file, and it's not included. Did you forget to edit the
> .cabal file? I think the use of LazyIO might appeal to me, as that is
> how Hoogle is currently structured, and I'd rather not switch to
> enumerators at this stage.

That's my fault on the comments: Network.Wai.Enumerator was removed in
0.3.0 to make a move to the enumerator package. As far as lazy IO:
there's no problem using lazy IO for create a response body, and
there's even a responseLBS helper function that should make it fairly
painless to do so. And since I doubt you'll be using the request body
at all, you can just do a liftIO on all your code to ignore the
Iteratee monad as well.

>> All of your desired features are easily implemented in Yesod except
>> the timeout one.
> I can implement timeout within my response easily enough, so I don't
> think that matters too much.
>> If you are interested in trying a migration to Yesod, just send me an
>> email (either privately or on web-devel).
> I think it's well documented enough that I'm not sure I'd have to.
> I've downloaded warp and will give it a try shortly.
> Thanks, Neil

Sure, good luck, and thanks for pointing out the documentation
problem, I'll take care of it soon.


More information about the web-devel mailing list