[Haskell-cafe] Mime / Mail library

Christopher Done chrisdone at googlemail.com
Sun Mar 20 15:50:44 CET 2011

On 20 March 2011 15:05, Pieter Laeremans <pieter at laeremans.org> wrote:

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

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.

We already have:
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.

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?

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110320/b99e58f2/attachment.htm>

More information about the Haskell-Cafe mailing list