[Haskell-beginners] Re: When to use ByteString rather than [Char] ... ?

Maciej Piechotka uzytkownik2 at gmail.com
Sun Apr 11 09:08:48 EDT 2010


On Sun, 2010-04-11 at 16:11 +0400, Mukhamed Karanashev wrote:
> Hi, James.
> Because "String" is represented by the "[Char]", each element of
> String is allocated individually. ByteString represents a string in a
> single array and hasn't overhead for allocating each char. 
> 

Hmm. I read somewhere that GHC optimizes it to handle it more as char *
if possible.

Could anyone clarify it?

Regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/beginners/attachments/20100411/65f9a063/attachment-0001.bin


More information about the Beginners mailing list