Lucu-0.2: HTTP Daemonic LibrarySource codeContentsIndex

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.

type ExtMap = Map String MIMEType
guessTypeByFileName :: ExtMap -> FilePath -> Maybe MIMEType
parseExtMapFile :: FilePath -> IO ExtMap
serializeExtMap :: ExtMap -> String -> String -> String
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