[Haskell-cafe] FastString a misnomer

Simon Marlow simonmar at microsoft.com
Thu Oct 20 05:45:28 EDT 2005


On 20 October 2005 09:48, Donald Bruce Stewart wrote:

> bulatz:
>> Hello John,
>> 
>> Thursday, October 20, 2005, 4:12:36 AM, you wrote:
>> 
>>> FastString seems to be a misnomer for this library.
>> 
>>> what it provides is a fast _byte array_ with a lot of useful
>>> operations, but it does not provide strings since it does not
>>> enforce character encodings in the type system, which would be
>>> vital for a real FastString library. In any case, just had to get
>>> that off my chest :) 
>> 
>> may be it can be named ByteArray? and then FastString.Latin1,
>> FastString.UTF8... will use its utilities
>> 
>> also, all UTF8 utilities may be placed outside of FastString.UTF8
>> module, because it can be used for something else
>> 
>> btw, FastString is also a bit misnamed. it's really a CompactString.
>> ghc's FastString was named so, imho, just because they provided
>> hashes for fast string comparision
> 
> Well, it's a PackedString really, isn't it? I changed it to FastString
> after too many people grumbled about colliding with the existing
> PackedString.

I think when this is ready it should replace Data.PackedString.

I don't necessarily mean put it into fptools/libraries/base - we could
just remove the existing Data.PackedString from there and your separate
package can provide Data.PackedString.  That is, unless we decide to use
it in GHC in some way, in which case we'll have to pull (a copy of) it
into fptools/libraries.

Cheers,
	Simon


More information about the Haskell-Cafe mailing list