[web-devel] ALPHA: http-types 0.1

Aristid Breitkreuz aristidb at googlemail.com
Fri Feb 4 09:16:22 CET 2011


Writing this from my phone, so I'll be brief.

I'm OK with the name CIByteString, I just thought the Http would clarify
that this is not safe for different encodings. But I can change this.

Parsing/rendering sounds like a good idea. I will probably use different
function names, but you can set up aliases in wai-extra, right?

Headers are already there, no? You're confusing me.

Thanks for the nice feedback!

Aristid
"sent from my Android"

Am 04.02.2011 07:09 schrieb "Michael Snoyman" <michael at snoyman.com>:

Alright, everything seems fine to me. Some more comments:

* Besides the fact that I think HttpCIByteString is too verbose, it
presents another problem: I cannot transparently switch over to it in
WAI and http-enumerator. If you kept the same name (CIByteString), I
could simply switch over to your version without any breaking changes.
* I like methodGet et al.
* Do you want to consider some parsing functions? I can provide you
the code. Some things I would imagine would be:
   * parseQueryString :: ByteString -> [(ByteString, Maybe
ByteString)] (I'm not sure if in practice anyone cares about the Maybe
btw, but you are right that it is more theoretically correct)
   * renderQueryString :: [(ByteString, Maybe ByteString)] -> ByteString
   * parsePath :: ByteString -> [String], which would do all
splitting-on-slash, percent decoding and UTF-8 decoding
   * renderPath :: [String] -> ByteString, which would be the reverse
of parsePath
   * renderPathQuery :: [String] -> [(ByteString, ByteString)] -> ByteString
   * parseHttpAccept :: ByteString -> [ByteString]
* Are you planning on adding headers as well?

Basically, feel free to raid Network.Wai.Parse[1].

[1]
http://hackage.haskell.org/packages/archive/wai-extra/0.3.1/doc/html/Network-Wai-Parse.html

On Fri, Feb 4, 2011 at 12:23 AM, Aristid Breitkreuz

<aristidb at googlemail.com> wrote:
> OK, I uploaded a fixed version:
> http://hackage.haskell.org/pack...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/web-devel/attachments/20110204/173ad853/attachment.htm>


More information about the web-devel mailing list