Individual MIME type to be served over the wire.
Equations
Instances For
Path extension. May include multiple components, e.g., "tar.gz".
Equations
Instances For
File name (without directory path).
Equations
Instances For
Maps extensions to MIME types.
Instances For
The default fallback MIME type: "application/octet-stream".
Equations
- Network.Mime.defaultMimeType = "application/octet-stream"
Instances For
Get a list of all file name extensions, from most specific to least. $$\text{fileNameExtensions}(\texttt{"foo.tar.gz"}) = [\texttt{"tar.gz"}, \texttt{"gz"}]$$
Equations
Instances For
A default mapping from filename extension to MIME type. Generated from Apache and nginx mime.types files + IANA registry. Covers the most common web content types.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Look up a MIME type from the given map and default, by file name. Tries each extension from most to least specific. $$\text{mimeByExt}(m, d, f) = \text{first match in } m \text{ for extensions of } f$$
Equations
- Network.Mime.mimeByExt mm default_ name = Network.Mime.mimeByExt.go mm default_ (Network.Mime.fileNameExtensions name)
Instances For
Equations
- Network.Mime.mimeByExt.go mm default_ [] = default_
- Network.Mime.mimeByExt.go mm default_ (e :: es) = match Network.Mime.assocLookup✝ e mm with | some mt => mt | none => Network.Mime.mimeByExt.go mm default_ es
Instances For
mimeByExt applied to defaultMimeType and defaultMimeMap.
$$\text{defaultMimeLookup} : \text{FileName} \to \text{MimeType}$$