X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Lucu.git;a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FMIMEType%2FGuess.hs;h=f0f93b1e8e224c5926c9c586b468a945acdd66c6;hp=eabc06ffe5808c9ee6c7b420172173730fb1534a;hb=9668dc27a02b59d7bfb1e9e40af3d2619700ad69;hpb=f402841101b4b84f263eea1a43c848f81c48ff93 diff --git a/Network/HTTP/Lucu/MIMEType/Guess.hs b/Network/HTTP/Lucu/MIMEType/Guess.hs index eabc06f..f0f93b1 100644 --- a/Network/HTTP/Lucu/MIMEType/Guess.hs +++ b/Network/HTTP/Lucu/MIMEType/Guess.hs @@ -1,8 +1,8 @@ {-# LANGUAGE UnicodeSyntax #-} --- |MIME Type guessing by a file extension. This is a poor man's way --- of guessing MIME Types. It is simple and fast. +-- |Guessing MIME Types by file extensions. It's not always accurate +-- but simple and fast. -- -- In general you don't have to use this module directly. module Network.HTTP.Lucu.MIMEType.Guess @@ -33,10 +33,10 @@ import Network.HTTP.Lucu.MIMEType import Prelude.Unicode import System.FilePath --- |'Map' from extension to 'MIMEType'. +-- |A 'Map' from file extensions to 'MIMEType's. type ExtMap = Map Text MIMEType --- |Guess the MIME Type of file. +-- |Guess the MIME Type of a file. guessTypeByFileName ∷ ExtMap → FilePath → Maybe MIMEType guessTypeByFileName extMap fpath = case takeExtension fpath of @@ -112,8 +112,8 @@ compile = go (∅) ∘ concat ∘ map tr -- -- * A definition of module named @moduleName@. -- --- * @variableName :: 'ExtMap'@ whose content is a serialization of --- @extMap@. +-- * @variableName :: 'ExtMap'@ whose content is the serialised +-- @extMap@. -- -- The module "Network.HTTP.Lucu.MIMEType.DefaultExtensionMap" is -- surely generated using this function.