<div><div class="gmail_quote">On 20 March 2011 15:05, Pieter Laeremans <span dir="ltr"><<a href="mailto:pieter@laeremans.org">pieter@laeremans.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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><meta http-equiv="content-type" content="text/html; charset=utf-8">I think the solution to this problem is a generic `string' 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're using Text, String, ByteString/Lazy/Char8, ropes, whatever, it's not the library writer'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">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"></a><br>Which works on Monoid and IsString, but there needs to be a class like "can be read/outputted via IO" and one for read/show/serialize, both of which are important for speed.</div>
<div><br></div><div>Anyone already done work on this? The Data.ByteString modules could export some instances. It's fair enough that people who need fine-grained speed use the concrete types and all their special-purposes functions, but in the general having to choose arbitrarily (often defaulting to String) is a burden. Can't we standardize on a default set of String classes to use?</div>
<div><br></div><div>I suppose I could try reducing Data.ByteString's function set into a set of essential core methods, seeing as the ByteString modules are a very good spec of what's required for a String type to be completely usable.</div>
</div></div>