
Hi Kevin,
thanks for the pointer, although I was aware of the thread and had followed
it quite closely, it was quite interesting.
But it never explained if and why String should be avoided, all I read is
"test and decide depending on the circumstances", which in itself is good
advise, but I'd like to have an idea of the reasons so I can form in idea
before actually having to code any benchmarks :)
Knowing that String literally is a linked list of Char makes it a lot
clearer. I figured that maybe Haskell could be using some more efficient
mechanism for Strings internally, only treating it outwardly as a [Char].
But I guess that in a lot of circumstances where you're just working with
small pieces of text in non-performance critical code it's perfectly okay to
use String.
Cheers,
-Tako
On Wed, Sep 1, 2010 at 08:31, Kevin Jardine
Hi Tako,
The issues involved with String, ByteString, Text and a few related libraries were discussed at great length recently in this thread:
http://groups.google.com/group/haskell-cafe/browse_thread/thread/52a21cf61ff...
Basically, Chars are 32 bit integers and Strings are represented as a list of Chars.
This is very convenient for small computations but often very inefficient for anything large scale.
The String API is also missing various encoding related features.
Because of the limitations of String, various alternative libraries have been proposed. Text is one important option.
You'll find much more detail on the above referenced thread.
Kevin
On Wed, Sep 1, 2010 at 07:14, John Millikin
wrote: Don't forget, you can always improve the text library yourself. I love to receive patches, requests for improvement, and bug reports.
Are there any areas in particular you'd like help with, for either library? I'm happy to assist any effort which will help reduce use of String.
As a Haskell noob I'm curious about this statement, is there something intrinsically wrong with String? Or is it more a performance/resource problem when dealing with large amounts of text for example? (Like having to use StringBuilder in Java if you want to avoid the
On Sep 1, 8:13 am, Tako Schotanus
wrote: penalty of repeated String allocations when simply concatenating for example)
Cheers, -Tako
_______________________________________________ Haskell-Cafe mailing list Haskell-C...@haskell.orghttp:// www.haskell.org/mailman/listinfo/haskell-cafe
Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe