"FastPackedString" considered harmful
Simon Marlow
simonmarhaskell at gmail.com
Thu Apr 20 05:16:05 EDT 2006
Data.ByteVector?
But I would expect a library called Data.Byte* to deal in terms of
Word8s, not Chars. The objective of the operation is to provide a
speedier [Char], so I'd be happy with Data.PackedString(.Latin1).
Perhaps the ideal structure would be something like (taking up Udo
Stenzel's suggestion):
Data.StorableVector
- data {- Storable w => -} StorableVector w
- implements all the FPS operations
- convert between ForeignPtr, StorableVector, StorableArray
Data.PackedString.Latin1
Data.PackedString.UTF8
- newtype PackedString = PS (StorableVector Word8)
Making all the appropriate specialisations happen might be a challenge,
though. An intermediate position is to provide Data.ByteVector and
Data.PackedString.* defined in terms of that.
Cheers,
Simon
Jean-Philippe Bernardy wrote:
> How about ByteSequence ?
>
> This is inline with Ross' Data.Sequence and Data.IntMap.
>
> Cheers,
> JP.
>
> On 4/20/06, Donald Bruce Stewart <dons at cse.unsw.edu.au> wrote:
>
>>On the topic of a good name for FPS, I think its fairly widely
>>considered that a packed byte "string" shouldn't be considered a String,
>>and thus FastPackedString is a potentially confusing misnomer.
>>It was always meant as a working title until something replaced
>>Data.PackedString anyway.
>>
>>If this library is to be imported into the base libraries, along with
>>future PackedString.Unicode and so on, layers on top, we should probably
>>get the name right now.
>>
>>I'm disinclined to call it a ByteArray module -- it doesn't really offer
>>array-like operations. And its got nothing much to do with the other
>>Array.* stuff.
>>
>>Instead, how about: Data.ByteString (with a connotation of IntMap) ?
>>
>>That seems to suggest both the stringy-ness of the api, but also the
>>restriction to bytes.
>>
>>-- Don
>>_______________________________________________
>>Libraries mailing list
>>Libraries at haskell.org
>>http://www.haskell.org/mailman/listinfo/libraries
>>
More information about the Libraries
mailing list