Lucu-0.3: HTTP Daemonic LibrarySource codeContentsIndex
Network.HTTP.Lucu.MIMEType.Guess
Description

MIME Type guessing by a file extension. This is a poor man's way of guessing MIME Types. It is simple and fast.

In general you don't have to use this module directly.

Synopsis
type ExtMap = Map String MIMEType
guessTypeByFileName :: ExtMap -> FilePath -> Maybe MIMEType
parseExtMapFile :: FilePath -> IO ExtMap
serializeExtMap :: ExtMap -> String -> String -> String
Documentation
type ExtMap = Map String MIMETypeSource
Map from extension to MIME Type.
guessTypeByFileName :: ExtMap -> FilePath -> Maybe MIMETypeSource
Guess the MIME Type of file.
parseExtMapFile :: FilePath -> IO ExtMapSource
Read an Apache mime.types and parse it.
serializeExtMap :: ExtMap -> String -> String -> StringSource

serializeExtMap extMap moduleName variableName generates a Haskell source code which contains the following things:

  • A definition of module named moduleName.
  • variableName :: ExtMap whose content is a serialization of extMap.

The module Network.HTTP.Lucu.MIMEType.DefaultExtensionMap is surely generated using this function.

Produced by Haddock version 2.4.2