[Haskell-cafe] bytestring vs. uvector

Alexander Dunlap alexander.dunlap at gmail.com
Mon Mar 9 21:29:28 EDT 2009


On Mon, Mar 9, 2009 at 3:12 AM, Henning Thielemann
<lemming at henning-thielemann.de> wrote:
>
> On Mon, 9 Mar 2009, Claus Reinke wrote:
>
>> Given the close relationship between uvector and vector, it would
>> be very helpful if both package descriptions on hackage could point to a
>> common haskell wiki page, starting out with the text
>> and link above, plus a link to the stream fusion paper (I hadn't been
>> aware that vector incorporates the recycling work, and had often wondered
>> about the precise relationship between those
>> two packages). Apart from saving others from similar confusion,
>> that would also provide a place to record experience with those two
>> alternatives.
>
> I have at least started a page which mentions the existing alternatives:
>   http://www.haskell.org/haskellwiki/Storable_Vector
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>

Thanks for all of the responses!

So let me see if my summary is accurate here:

- ByteString is for just that: strings of bytes, generally read off of
a disk. The Char8 version just interprets the Word8s as Chars but
doesn't do anything special with that.
- Data.Text/text library is a higher-level library that deals with
"text," abstracting over Unicode details and treating each element as
a potentially-multibye "character."
- utf8-string is a wrapper over ByteString that interprets the bytes
in the bytestring as potentially-multibye unicode "characters."

- uvector, storablevector and vector are all designed for dealing with
arrays. They *can* be used for characters/word8s but are not
specialized for that purpose, do not deal with Unicode at all, and are
probably worse at it. They are better for dealing with things that you
would generally use arrays for.

If that seems accurate, I'll put it on the wiki.

Alex


More information about the Haskell-Cafe mailing list