text/x-haskell and text/x-literate-haskell added to the GNOME MIME database

Martin Norbäck d95mback@dtek.chalmers.se
18 Apr 2002 11:49:25 +0200

Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

tor 2002-04-18 klockan 11.32 skrev Keith Wansbrough:
> > These MIME types has now been added to the GNOME MIME database:
> >
> > text/x-haskell for *.hs
> > text/x-literate-haskell for *.lhs
> Note the following thread from August 1999: application/x-haskell has
> already been proposed and used.
> http://www.dcs.gla.ac.uk/mail-www/haskell/msg01843.html
> http://www.dcs.gla.ac.uk/mail-www/haskell/msg01849.html
> http://www.dcs.gla.ac.uk/mail-www/haskell/msg01853.html

I am aware of that discussion, but I chose text/* anyway.

> "application" seems more appropriate for Fritz Ruehr's goal here,
> which is a script that can be clicked on to make it run (using
> runhugs, presumably).  I can see your reasoning for "text", though.
> What is used for Javascript code at present?  Or for C source code?

I've seen both text/javascript and application/x-javascript being used.
GNOME has text/x-c for c code. Generally it has text for all program
code in text format.

RFC 2045 says:

   In general, the top-level media type is used to declare the general
   type of data, while the subtype specifies a specific format for that
   type of data.  Thus, a media type of "image/xyz" is enough to tell a
   user agent that the data is an image, even if the user agent has no
   knowledge of the specific image format "xyz".  Such information can
   be used, for example, to decide whether or not to show a user the raw
   data from an unrecognized subtype -- such an action might be
   reasonable for unrecognized subtypes of text, but not for
   unrecognized subtypes of image or audio. [...]

Having application/x-haskell as the MIME type means that anyone that
hasn't set up a viewer for that MIME type will not see it as text in the

So using text/ is a good way of specifying that the fallback of just
showing the contents as text is perfectly OK.

Even better maybe would be to have source/haskell, but introducing a
completely new top-level media type is a bit heavy.



Martin Norb=E4ck          d95mback@dtek.chalmers.se
Kapplandsgatan 40       +46 (0)708 26 33 60
S-414 78  G=D6TEBORG      http://www.dtek.chalmers.se/~d95mback/
SWEDEN                  OpenPGP ID: 3FA8580B

Content-Type: application/pgp-signature; name=signature.asc

Version: GnuPG v1.0.6 (GNU/Linux)
Comment: För information se http://www.gnupg.org/