[Haskell-cafe] ANN: Cute Hack - Hyena handler + Bamboo Blog Engine :)

Jinjing Wang nfjinjing at gmail.com
Sat Apr 25 07:22:45 EDT 2009


Yes, the spec is almost a direct translation from Rack.

For middleware, I translated some from Rack, but it does not have to
be a port. I'm just lazy.

Rack borrowed some basic middleware from WSGI too, like Lint.

About the style, it's a bit weird, yes. But only in module scope ;)

On Sat, Apr 25, 2009 at 7:00 PM, Sebastiaan Visser <sfvisser at cs.uu.nl> wrote:
> What kind of port is this? Direct translation from ruby source?
>
> I see that you are using the (.) for OO-style reversed function application.
> Which feels a bit weird at first sight.
>
> Snippet from your Hack.Handler.Kibro:
>
>>handle app = do
>>  env <- get_env
>>  response <- app env .liftIO
>>
>>  -- set response
>>  response.headers.mapM_ (splash setHeader)
>>  response.status.show.setHeader "Status"
>>  response.body.output
>
> On Apr 25, 2009, at 7:58 AM, Jinjing Wang wrote:
>>
>> Hia,
>>
>> A few interesting progress on Hack:
>>
>> * many middleware ported from Rack, including a lambda! ( just like a
>> pony for wsgi, and a lobster for rack )
>> * 2 handlers, one for Kibro on fcgi / lighttpd, one for Hyena web server
>> * apps are portable, Bamboo is a port of Panda that runs on Hack,
>> works fine with both handlers
>> * Hyena handler is still experimental
>>
>> A lambda app looks like this
>>
>> -- Main.hs source
>>
>> module Main where
>>
>> import Hack
>> import Hack.Utils
>>
>> import Hack.Handler.Hyena
>> import Hack.Contrib.Lambda
>>
>> main = run $ lambda dummy_app
>>
>> -- compile
>>
>> ghc --make -O2 Main.hs
>>
>> -- run
>> ./Main
>>
>>
>> now go to http://localhost:3000/lambda
>>
>> Cheers,
>>
>> Links:
>>
>> * [Hack] (http://github.com/nfjinjing/hack/tree/master)
>> * [Bamboo] (http://github.com/nfjinjing/bamboo/tree/master)
>
>



-- 
jinjing


More information about the Haskell-Cafe mailing list