So all the `pipes-parse` work is done and while Renzo is upgrading his
libraries I want to renew discussions about a `pipes`-based HTTP client
now that I think all that the necessary groundwork has been laid by
`pipes-parse` and `pipes-bytestring`.
The key missing component before was a way to delimit parsers by length
which is necessary to implement a secure client/server. Now you can do
this using lens-based parsing combined with the
`Pipes.ByteString.splitAt` lens. Given some parser for a field/header like:
headerParser
:: Monad m => Parser ByteString m (Maybe Header)
... you can now transparently restrict that parser to a fixed number of
bytes like this:
zoom (splitAt numBytes) headerParser
:: Monad m => Parser ByteString m (Maybe Header)
Any leftovers from `someParser` will still be correctly retained. For
example, if you write:
header <- zoom (splitAt numBytes) headerParser
someOtherParser
... then any leftovers undrawn by `headerParser` will automatically be
available to `someOtherParser`.
So, I want to kick off this discussion by saying that Michael Snoyman
has released `conduit`-independent HTTP/HTTPS client libraries called
`http-client` and `http-client-tls`. Things I would like to discuss
include:
* Should we just reuse `http-client`/`http-client-tls`? Writing a
`pipes` wrapper on top of these would be very quick and painless and I
could do it myself in a couple of days.
* Should we not use them and reuse something else (like Andrew's
proposed http-streams for `pipes`)?
--
You received this message because you are subscribed to the Google Groups "Haskell
Pipes" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].