You might also look at Data.Rope from the rope library, which provides an O(1) append for strict bytestring chunks, and the ability to decode UTF-8 chars from the result.<br><br><a href="http://hackage.haskell.org/packages/archive/rope/0.6.1/doc/html/Data-Rope.html">http://hackage.haskell.org/packages/archive/rope/0.6.1/doc/html/Data-Rope.html</a><br>
<br>I&#39;d also be happy to work with you if the current API falls short of your needs.<br><br>-Edward Kmett<br><br><div class="gmail_quote">On Thu, Jun 3, 2010 at 10:03 AM, Kevin Jardine <span dir="ltr">&lt;<a href="mailto:kevinjardine@yahoo.com">kevinjardine@yahoo.com</a>&gt;</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;">(I&#39;ve done a basic Google search on this with no results. Apologies if this has been asked before.)<br>

<br>
I am coding a web application in which the content is a Unicode string built up over multiple functions and maintained in a State structure.<br>
<br>
I gather that the String module is inefficient and that Data.Text would be a better choice.<br>
<br>
Is it more efficient to build up a list of Text objects over time and combine them together with a single Data.Text.concat for the final output or to run Data.Text.append for each new string so that I am maintaining a single Text object rather than a list?<br>

<br>
As Data.Text.append requires copying both strings each time, my gut feeling is that concat would be much more efficient, but Haskell has surprised me before, so I wanted to check.<br>
<br>
Kevin<br>
<br>
<br>
<br>
_______________________________________________<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>
</blockquote></div><br>