[darcs-devel] MIME parsing

Taral taral at taral.net
Wed Oct 6 11:42:53 PDT 2004


On Wed, Oct 06, 2004 at 07:32:15AM -0400, David Roundy wrote:
> I think giving names to the fields in these data objects would help, both
> to document them, and also to make it easier to use (and read) the code
> that uses this.
> 
> data MIMEPart =
>     MIMEPart {headers :: Alist,
>               ??? :: String, etc}

Yes, I was going to do that eventually. :)

> I also wonder if we need to export so many data types.  Perhaps it's
> unavoidable, but maybe we could have fewer multi-constructor data types?
> 
> data MimePart = MultiPart AList (String, String, AList) [MimePart] |
>                 DataPart AList (String, String, AList) String

The problem with this is that many users will only want those first two
fields, and not the third. So I factored them out.

> Perhaps also the "RFC822 AList String" could be treated as a "DataPart
> AList (String, String, AList) String"? Then we might be able to have just
> one data type:

Unfortunately not. RFC822 represents a message that does not have
MIME-Version, and thus cannot be interpreted as MIME at all.

> but I'm not sure what the (String, String, Alist) is, so I'm not sure if
> this could work.

That's a content-type. It'll be more obvious when I fix up the types.

> In case you can't tell, I've looked more at the interface than the
> implementation, since I don't know anything to speak of about MIME itself.

Every little bit helps!

-- 
Taral <taral at taral.net>
This message is digitally signed. Please PGP encrypt mail to me.
"Some people cause happiness wherever they go; others, whenever they go."
    -- Oscar Wilde
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-devel/attachments/20041006/589aa0c4/attachment.pgp


More information about the darcs-devel mailing list