Documentation

Hale.MimeTypes.Network.Mime

@[reducible, inline]

Individual MIME type to be served over the wire.

Equations
Instances For
    @[reducible, inline]

    Path extension. May include multiple components, e.g., "tar.gz".

    Equations
    Instances For
      @[reducible, inline]

      File name (without directory path).

      Equations
      Instances For
        @[reducible, inline]

        Maps extensions to MIME types.

        Equations
        Instances For

          The default fallback MIME type: "application/octet-stream".

          Equations
          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
                def Network.Mime.mimeByExt (mm : MimeMap) (default_ : MimeType) (name : FileName) :

                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
                Instances For
                  Equations
                  Instances For

                    mimeByExt applied to defaultMimeType and defaultMimeMap. $$\text{defaultMimeLookup} : \text{FileName} \to \text{MimeType}$$

                    Equations
                    Instances For