<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
From: Christopher Done &lt;<a href="mailto:chrisdone@googlemail.com">chrisdone@googlemail.com</a>&gt;<br>
<br>
On 20 March 2011 15:05, Pieter Laeremans &lt;<a href="mailto:pieter@laeremans.org">pieter@laeremans.org</a>&gt; wrote:<br>
<br>
&gt; Hi all,<br>
&gt;<br>
&gt; The MIME package that can be found on hackage, uses String as input.<br>
&gt; Would i be considered better if there would be a version based on Text, or<br>
&gt; ByteString ?<br>
&gt;<br>
<br>
I think the solution to this problem is a generic `string&#39; package which<br>
just provides a few classes. The MIME library would export an interface that<br>
only deals with instances of these classes, and whether you&#39;re using Text,<br>
String, ByteString/Lazy/Char8, ropes, whatever, it&#39;s not the library<br>
writer&#39;s concern or assumptions to make.<br>
<br>
We already have:<br>
<a href="http://hackage.haskell.org/packages/archive/string-combinators/0.6/doc/html/Data-String-Combinators.html" target="_blank">http://hackage.haskell.org/packages/archive/string-combinators/0.6/doc/html/Data-String-Combinators.html</a><br>

&lt;<a href="http://hackage.haskell.org/packages/archive/string-combinators/0.6/doc/html/Data-String-Combinators.html" target="_blank">http://hackage.haskell.org/packages/archive/string-combinators/0.6/doc/html/Data-String-Combinators.html</a>&gt;<br>

Which works on Monoid and IsString, but there needs to be a class like &quot;can<br>
be read/outputted via IO&quot; and one for read/show/serialize, both of which are<br>
important for speed.<br>
<br>
Anyone already done work on this? The Data.ByteString modules could export<br>
some instances. It&#39;s fair enough that people who need fine-grained speed use<br>
the concrete types and all their special-purposes functions, but in the<br>
general having to choose arbitrarily (often defaulting to String) is a<br>
burden. Can&#39;t we standardize on a default set of String classes to use?<br>
<br>
I suppose I could try reducing Data.ByteString&#39;s function set into a set of<br>
essential core methods, seeing as the ByteString modules are a very good<br>
spec of what&#39;s required for a String type to be completely usable.<br></blockquote><div><br>Data.ListLike (<a href="http://hackage.haskell.org/package/ListLike">http://hackage.haskell.org/package/ListLike</a>) provides this via the &quot;StringLike&quot; class (and StringLikeIO).  There are built-in instances for Strings and ByteStrings, with orphan Text instances in <a href="http://hackage.haskell.org/package/listlike-instances">http://hackage.haskell.org/package/listlike-instances</a>.<br>
<br>Probably the StringLike class could be extended to provide more (high-performance) methods, but I don&#39;t have a good idea of what&#39;s necessary.  Suggestions are welcome!<br><br>John L.<br></div></div>