Hi Kevin,<br><br>thanks for the pointer, although I was aware of the thread and had followed it quite closely, it was quite interesting.<br>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 :)<br>
<br>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.<br>
<br>Cheers,<br>-Tako<br>
<br><br><div class="gmail_quote">On Wed, Sep 1, 2010 at 08:31, Kevin Jardine <span dir="ltr"><<a href="mailto:kevinjardine@gmail.com">kevinjardine@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi Tako,<br>
<br>
The issues involved with String, ByteString, Text and a few related<br>
libraries were discussed at great length recently in this thread:<br>
<br>
<a href="http://groups.google.com/group/haskell-cafe/browse_thread/thread/52a21cf61ffb21b0/" target="_blank">http://groups.google.com/group/haskell-cafe/browse_thread/thread/52a21cf61ffb21b0/</a><br>
<br>
Basically, Chars are 32 bit integers and Strings are represented as a<br>
list of Chars.<br>
<br>
This is very convenient for small computations but often very<br>
inefficient for anything large scale.<br>
<br>
The String API is also missing various encoding related features.<br>
<br>
Because of the limitations of String, various alternative libraries<br>
have been proposed. Text is one important option.<br>
<br>
You'll find much more detail on the above referenced thread.<br>
<br>
Kevin<br>
<br>
On Sep 1, 8:13 am, Tako Schotanus <<a href="mailto:t...@codejive.org">t...@codejive.org</a>> wrote:<br>
<div><div></div><div class="h5">> On Wed, Sep 1, 2010 at 07:14, John Millikin <<a href="mailto:jmilli...@gmail.com">jmilli...@gmail.com</a>> wrote:<br>
><br>
> > > Don't forget, you can always improve the text library yourself. I love to<br>
> > receive<br>
> > > patches, requests for improvement, and bug reports.<br>
><br>
> > Are there any areas in particular you'd like help with, for either<br>
> > library? I'm happy to assist any effort which will help reduce use of<br>
> > String.<br>
><br>
> As a Haskell noob I'm curious about this statement, is there something<br>
> intrinsically wrong with String?<br>
> Or is it more a performance/resource problem when dealing with large amounts<br>
> of text for example?<br>
> (Like having to use StringBuilder in Java if you want to avoid the penalty<br>
> of repeated String allocations when simply concatenating for example)<br>
><br>
> Cheers,<br>
> -Tako<br>
><br>
</div></div>> _______________________________________________<br>
> Haskell-Cafe mailing list<br>
> Haskell-C...@haskell.orghttp://<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<div><div></div><div class="h5">_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br>