[web-devel] Proposal: http-types

Neil Mitchell ndmitchell at gmail.com
Wed Feb 2 13:21:37 CET 2011


>> hdrContentType :: IsString a => a
>>
>> And similarly for all values that are just strings. You eliminate the
>> bytestring package dependency, and nothing will need to know whether
>> things are String, Text, LazyByteString, ByteString or CIByteString
>> (or even Builder values).
>
> You most definitely need to know whether something is Unicode or
> binary data. For example, the IsString type for ByteString is in
> essence an unsafe cast from [Word8] to [Char], assuming that the
> [Word8] contains latin1 encoded text. This assumption is not checked.

But everything in this package would be ASCII without the top bit set,
so would work regardless of encoding. For general strings manipulated
by a web page knowing the encoding is important, but the http
responses should be safe.

Thanks, Neil



More information about the web-devel mailing list