Network.HTTP.Media.Language

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

Safe Haskell | Safe-Inferred
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 RFC4647.

Specifically:

    language-range = (1*8ALPHA *("-" 1*8alphanum)) / "*"

#### Instances

Instances details

IsString Language # |
Instance details Defined in Network.HTTP.Media.Language.Internal Methods fromString :: String -> Language #
Show Language # |
Instance details Defined in Network.HTTP.Media.Language.Internal Methods showsPrec :: Int -> Language -> ShowS # show :: Language -> String # showList :: [Language] -> ShowS #
Eq Language # |
Instance details Defined in Network.HTTP.Media.Language.Internal Methods (==) :: Language -> Language -> Bool # (/=) :: Language -> Language -> Bool #
Ord Language # |
Instance details Defined in Network.HTTP.Media.Language.Internal 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 #
Accept Language # |
Instance details Defined in Network.HTTP.Media.Language.Internal Methods parseAccept :: ByteString -> Maybe Language # matches :: Language -> Language -> Bool # moreSpecificThan :: Language -> Language -> Bool # hasExtensionParameters :: Proxy Language -> Bool #
RenderHeader Language # |
Instance details Defined in Network.HTTP.Media.Language.Internal Methods renderHeader :: Language -> ByteString #

toParts :: Language -> [CI ByteString] #

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