<br><br><div class="gmail_quote">On Sun, Mar 20, 2011 at 10:50 AM, Christopher Done <span dir="ltr">&lt;<a href="mailto:chrisdone@googlemail.com">chrisdone@googlemail.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;">
<div><div class="gmail_quote"><div class="im">On 20 March 2011 15:05, Pieter Laeremans <span dir="ltr">&lt;<a href="mailto:pieter@laeremans.org" target="_blank">pieter@laeremans.org</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;">


Hi all,<div><br></div><div>The MIME package that can be found on hackage, uses String as input.</div><div>Would i be considered better if there would be a version based on Text, or ByteString ?</div></blockquote><div><br>


</div></div>I think the solution to this problem is a generic `string&#39; package which just provides a few classes. The MIME library would export an interface that only deals with instances of these classes, and whether you&#39;re using Text, String, ByteString/Lazy/Char8, ropes, whatever, it&#39;s not the library writer&#39;s concern or assumptions to make.<div>


<br>We already have: <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></div>


<div><a href="http://hackage.haskell.org/packages/archive/string-combinators/0.6/doc/html/Data-String-Combinators.html" target="_blank"></a><br>Which works on Monoid and IsString, but there needs to be a class like &quot;can be read/outputted via IO&quot; and one for read/show/serialize, both of which are important for speed.</div>
<br></div></div></blockquote></div><br><br>One possible extension to the Data-String-Combinators approach can be found in my new incremental-parser package (<a href="http://hackage.haskell.org/package/incremental-parser-0.1">http://hackage.haskell.org/package/incremental-parser-0.1</a>), which I should soon announce. It relies on three Data.Monoid subclasses, all plain Haskell 98, that allow monoids to be decomposed and parsed. There are instances for lists, ByteString, and Text. It&#39;s a different approach from ListLike, because it abstracts away the Char type.<br>
<br>Like with any abstraction, though, there is performance cost for some operations. It could be minimized by adding more defaulted methods to the FactorialMonoid class, but for the first release I concentrated on what the parser needed.<br>
<br>