[Haskell-cafe] Strings - why [Char] is not nice
ekarttun at cs.helsinki.fi
Mon Sep 20 15:50:07 EDT 2004
On 20.09 15:05, Dylan Thurston wrote:
> You know about the PackedString functions, right?
Yes, but they are quite broken. I am using FastPackedString from
darcs for many purposes, which is like PackedString in many
PackedStrings use full unicode codepoints (4*size in bytes), but
having a char > 256 in them does not work if one wants to do IO.
This means essentially that the wasted space cannot be used in any
Also concatenating PackedStrings is not very nice:
concatPS pss = packString (concat (map unpackPS pss))
And most important they need a conversion (unpackPS), before
using them with external libraries which expect Strings.
- Einar Karttunen
More information about the Haskell-Cafe