Hi all,

I'm using Wai and http-enumerator to build a http proxy. The core of
the code looks like this:

    import qualified Network.HTTP.Enumerator     as HE
    import qualified Network.Wai                 as Wai

    serveRequest :: forall (m :: * -> *).
             (MonadControlIO m, Failure HE.HttpException m) =>
             HE.Request m -> m Wai.Response
    serveRequest request
     = do   HE.Response sc rh bs <- HE.withManager $ HE.httpLbsRedirect request
            return $ Wai.responseLBS (mkStatus sc) rh bs

This works but does not run in constant space as I would have hoped.
The thing is, HE.httpLbsRedirect returns a lazy ByteString and
Wai.responseLBS writes a lazy ByteString, so why isn't the whole thing
lazy?

I'd appreciate any clues.

Cheers,
Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to