[web-devel] Simple mime-type package

Jeremy Shaw jeremy at n-heptane.com
Thu Apr 22 12:42:21 EDT 2010


Hello,

I am not especially excited about it. The fact that some mime-types  
are hard coded, and others are not is an annoying 'inconsistency'.

There is no way to extend the list of supported types in user apps.  
And typeByExt has a rather limited set up extensions, declaring  
everything else to be application/octet-stream.

The use of a type for the mime-types implies that you want to be  
pattern matching on the constructors in your code ? Can you give a use  
case for that ?

- jeremy

On Apr 21, 2010, at 11:56 AM, Michael Snoyman wrote:

> Hi all,
>
> In Yesod, I have very modest needs when it comes to mime-types.  
> Basically, I want:
>
> * a data type to represent mime-types
> * convert a string to a mime-type
> * convert a mime-type to a string
> * determine mime-type of a file based on extension
>
> I've stuck all this in a simple module: Web.Mime[1]. However, it  
> seems like this is a perfect candidate for a dedicated package. So I  
> wanted to ask:
>
> 1) Is there a package out there- with minimal dependencies- that  
> supplies this functionality?
> 2) If not, would anyone else find it useful if I split this off into  
> its own package?
>
> Michael
>
> [1] http://github.com/snoyberg/yesod/blob/ver0.2/Web/Mime.hs
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/web-devel/attachments/20100422/01b3be01/attachment.html


More information about the web-devel mailing list