[Haskell-cafe] Data.ByteString vs Data.ByteString.Lazy vs Data.ByteString.Char8

Galchin, Vasili vigalchin at gmail.com
Tue Dec 2 21:18:40 EST 2008


I am getting a collision with "Internal" .... sigh.


vasili

On Tue, Dec 2, 2008 at 5:59 PM, Duncan Coutts
<duncan.coutts at worc.ox.ac.uk>wrote:

> On Tue, 2008-12-02 at 17:43 -0600, Galchin, Vasili wrote:
> > Hello,
> >
> >      Some mention is made in corresponding web pages about
> > implementation difference of these three different DataString impl.
> > Any advice?
>
> Perhaps you need to ask a more specific question.
>
> Data.ByteString is a simple strict sequence of bytes (as Word8). That
> means the whole thing is in memory at once in one big block.
>
> Data.ByteString.Char8 provides the same type as Data.ByteString but the
> operations are in terms of 8-bit Chars. This is for use in files and
> protocols that contain ASCII as a subset. This is particularly useful
> for protocols containing mixed text and binary content. It should not be
> used instead of proper Unicode.
>
>
> Data.ByteString.Lazy is a different representation. As the name
> suggests, it's lazy like a lazy list. So like a list the whole thing
> does not need to be in memory if it can be processed incrementally. It
> supports lazy IO, like getContents does for String. It is particularly
> useful for handling long or unbounded streams of data in a pure style.
>
> Data.ByteString.Lazy.Char8 is the Char8 equivalent.
>
> Duncan
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20081202/7c19028a/attachment.htm


More information about the Haskell-Cafe mailing list