[Haskell-cafe] Contributing to http-conduit

Michael Snoyman michael at snoyman.com
Tue Jan 24 07:43:03 CET 2012


On Tue, Jan 24, 2012 at 8:37 AM, Myles C. Maxfield
<myles.maxfield at gmail.com> wrote:
> I have attached a patch to add a redirect chain to the Response datatype.
> Comments on this patch are very welcome.

I thought that this isn't necessary since a client wanting to track
all the redirects could just handle them manually by setting the
redirect count to 0.

> I was originally going to include the entire Request object in the
> redirection chain, but Request objects are parameterized with a type 'm', so
> including a 'Request m' field would force the Response type to be
> parameterized as well. I felt that would be too large a change, so I made
> the type of the redirection chain W.Ascii.
>
> Perhaps its worth using the 'forall' keyword to get rid of the pesky 'm'
> type parameter for Requests?
>
> data RequestBody
>     = RequestBodyLBS L.ByteString
>     | RequestBodyBS S.ByteString
>     | RequestBodyBuilder Int64 Blaze.Builder
>     | forall m. RequestBodySource Int64 (C.Source m Blaze.Builder)
>     | forall m. RequestBodySourceChunked (C.Source m Blaze.Builder)

There'd be no way to run the request body then (try compiling the code
after that change).

Michael



More information about the Haskell-Cafe mailing list