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 <kevinjard...@gmail.com> wrote: > 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/52a21cf61ffb21b0/ > > 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 Sep 1, 8:13 am, Tako Schotanus <t...@codejive.org> wrote: > > On Wed, Sep 1, 2010 at 07:14, John Millikin <jmilli...@gmail.com> 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 > 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 >
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe