[web-devel] Proposal: http-types
Johan Tibell
johan.tibell at gmail.com
Wed Feb 2 13:07:10 CET 2011
On Wed, Feb 2, 2011 at 12:04 PM, Neil Mitchell <ndmitchell at gmail.com> wrote:
> Why not do:
>
> 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.
Johan
More information about the web-devel
mailing list