| Copyright | Dennis Gosnell 2017 |
|---|---|
| License | BSD3 |
| Maintainer | Dennis Gosnell (cdep.illabout@gmail.com) |
| Stability | experimental |
| Portability | unknown |
| Safe Haskell | None |
| Language | Haskell2010 |
Servant.Static.TH.Internal.Mime
Description
This module exports functions and datatypes for using many different mime types.
- data MimeTypeInfo = MimeTypeInfo {}
- byteStringToExp :: ByteString -> Q Exp
- utf8ByteStringToExp :: ByteString -> Q Exp
- htmlToExp :: ByteString -> Q Exp
- extensionMimeTypeMap :: Map String MimeTypeInfo
- extensionToMimeTypeInfoEx :: FilePath -> Q MimeTypeInfo
- extensionToMimeTypeInfo :: FilePath -> Maybe MimeTypeInfo
- data CSS
- data GIF
- data JPEG
- data JS
- data PNG
- data SVG
- data TXT
Documentation
data MimeTypeInfo Source #
Hold Types and functions work working with a given file type, like
html or js.
You can find examples of MimeTypeInfo in the function
extensionMimeTypeMap.
Constructors
| MimeTypeInfo | |
Fields
| |
byteStringToExp :: ByteString -> Q Exp Source #
utf8ByteStringToExp :: ByteString -> Q Exp Source #
extensionMimeTypeMap :: Map String MimeTypeInfo Source #
A mapping from an extension like html or js to a MimeTypeInfo for
that extension.
extensionToMimeTypeInfoEx :: FilePath -> Q MimeTypeInfo Source #
Just like extensionToMimeTypeInfo, but throw an error using fail if
the extension for the given FilePath is not found.
extensionToMimeTypeInfo :: FilePath -> Maybe MimeTypeInfo Source #
Lookup the MimeTypeInfo for a given FilePath (that has an extension
like .html or .js). Returns Nothing if the MimeTypeInfo for the
given extension is not found.