[Haskell-cafe] Re: String vs ByteString

Felipe Lessa felipe.lessa at gmail.com
Sun Aug 15 12:06:53 EDT 2010

On Sun, Aug 15, 2010 at 12:50 PM, Donn Cave <donn at avvanta.com> wrote:
> I wonder how many ByteString users are `working with bytes', in the
> sense you apparently mean where the bytes are not text characters.
> My impression is that in practice, there is a sizeable contingent
> out here using ByteString.Char8 and relatively few applications for
> the Word8 type.  Some of it should no doubt move to Text, but the
> ability to work with native packed data - minimal processing and
> space requirements, interoperability with foreign code, mmap, etc. -
> is attractive enough that the choice can be less than obvious.

Using ByteString.Char8 doesn't mean your data isn't a stream of bytes,
it means that it is a stream of bytes but for convenience you prefer
using Char8 functions.  For example, a DNA sequence (AATCGATACATG...)
is a stream of bytes, but it is better to write 'A' than 65.

But yes, many users of ByteStrings should be using Text. =)



More information about the Haskell-Cafe mailing list