http-media-0.7.1: Processing HTTP Content-Type and Accept headers

Safe Haskell | Safe
Language | Haskell2010

Network.HTTP.Media.Language

Description

Defines the `Language` accept header with an `Accept` instance for use in language negotiation.

Synopsis

- data Language
- toParts :: Language -> [CI ByteString]

# Documentation

data Language #

Suitable for HTTP language-ranges as defined in RFC2616.

Specifically:

    language-range = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" )

Instances

Eq Language # |
Methods (==) :: Language -> Language -> Bool # (/=) :: Language -> Language -> Bool #
Ord Language # |
Methods compare :: Language -> Language -> Ordering # (<) :: Language -> Language -> Bool # (<=) :: Language -> Language -> Bool # (>) :: Language -> Language -> Bool # (>=) :: Language -> Language -> Bool # max :: Language -> Language -> Language # min :: Language -> Language -> Language #
Show Language # |
Methods showsPrec :: Int -> Language -> ShowS # show :: Language -> String # showList :: [Language] -> ShowS #
IsString Language # |
Methods fromString :: String -> Language #
RenderHeader Language # |
Methods renderHeader :: Language -> ByteString #
Accept Language # |
Methods parseAccept :: ByteString -> Maybe Language # matches :: Language -> Language -> Bool # moreSpecificThan :: Language -> Language -> Bool # hasExtensionParameters :: Proxy * Language -> Bool #

toParts :: Language -> [CI ByteString] #

Converts `Language` to a list of its language parts. The wildcard produces an empty list.