
On Sat, Jun 14, 2008 at 1:50 PM, Sebastiaan Visser
Doesn't this imply that the parseHttpHeader must work on ByteStrings instead of regular Strings?
I made the change because it's easier and faster to go from ByteString to String than the converse.
Maybe this works for HTTP headers, but sometimes ByteStrings are not appropriate. Especially when you are not using the regular `System.IO.hGetContents' but the `System.IO.UTF8.hGetContents'.
You may use the package encoding instead, take a look at [1]. It will decode a lazy ByteString into a String. In your HTTP parsing example, you could break the ByteString on "\r\n\r\n" and then decodeLazy only the first part, while returning the second without modifying it. [1] http://hackage.haskell.org/packages/archive/encoding/0.4.1/doc/html/Data-Enc... -- Felipe.