This modules provides the union type MimeType to model some of the most common mime types and a parsing function that tries to parse a MimeType. The possible values for MimeType are all union types as well that specify the Sub-type. It was originally developed to classify files dropped into the browser via the HTML5 Drag and Drop api.
This library ATM provides only an incomplete, somewhat arbitrary mapping of the most common browser mime types. See https://code.google.com/p/chromium/codesearch#chromium/src/net/base/mime_util.cc&l=201 for a full list of Mime types as implemented in chromium.
Tries to parse the Mime type from a string.
-- normal use of a type/subtype that is modelled:
parseMimeType "image/jpeg" == Just (Image Jpeg)
-- use of a subtype that is not modelled ATM
parseMimeType "image/tiff" == Just (Image OtherImage)
-- use with an empty string
parseMimeType "" == Nothing
-- use with something else
parseMimeType "bla" == Just OtherMimeTypeModels the most common text subtypes
Models the most common image subtypes
Models the most common audio subtypes
Models the most common video subtypes
Models the major types image, audio, video and text with a subtype or OtherMimeType