Hoogle Search
Within LTS Haskell 24.3 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
mapAcceptCharset :: [(Charset, b)] -> ByteString -> Maybe bhttp-media Network.HTTP.Media A specialisation of mapAccept that only takes Charset as its input, to avoid ambiguous-type errors when using string literal overloading.
getHeader >>= maybe render406Error renderResource . mapAcceptCharset [ ("utf-8", inUtf8) , ("us-ascii", inAscii) ]
mapAcceptEncoding :: [(Encoding, b)] -> ByteString -> Maybe bhttp-media Network.HTTP.Media A specialisation of mapAccept that only takes Encoding as its input, to avoid ambiguous-type errors when using string literal overloading.
getHeader >>= maybe render406Error renderResource . mapAcceptEncoding [ ("compress", compress) , ("identity", id) ]
mapAcceptLanguage :: [(Language, b)] -> ByteString -> Maybe bhttp-media Network.HTTP.Media A specialisation of mapAccept that only takes Language as its input, to avoid ambiguous-type errors when using string literal overloading.
getHeader >>= maybe render406Error renderResource . mapAcceptLanguage [ ("en-gb", inBritishEnglish) , ("fr", inFrench) ]
mapAcceptMedia :: [(MediaType, b)] -> ByteString -> Maybe bhttp-media Network.HTTP.Media A specialisation of mapAccept that only takes MediaType as its input, to avoid ambiguous-type errors when using string literal overloading.
getHeader >>= maybe render406Error renderResource . mapAcceptMedia [ ("text/html", asHtml) , ("application/json", asJson) ]
mapContent :: Accept a => [(a, b)] -> ByteString -> Maybe bhttp-media Network.HTTP.Media The equivalent of matchContent above, except the resulting choice is mapped to another value.
getContentType >>= maybe send415Error readRequestBodyWith . mapContent [ ("application" // "json", parseJson) , ("text" // "plain", parseText) ]
mapContentCharset :: [(Charset, b)] -> ByteString -> Maybe bhttp-media Network.HTTP.Media A specialisation of mapContent that only takes Charset as its input, to avoid ambiguous-type errors when using string literal overloading.
getContentCharset >>= maybe send415Error readRequestBodyWith . mapContentCharset [ ("utf-8", parseUtf8) , ("us-ascii", parseAscii) ]
mapContentEncoding :: [(Encoding, b)] -> ByteString -> Maybe bhttp-media Network.HTTP.Media A specialisation of mapContent that only takes Encoding as its input, to avoid ambiguous-type errors when using string literal overloading.
getContentEncoding >>= maybe send415Error readRequestBodyWith . mapContentEncoding [ ("compress", decompress) , ("identity", id) ]
mapContentLanguage :: [(Language, b)] -> ByteString -> Maybe bhttp-media Network.HTTP.Media A specialisation of mapContent that only takes Language as its input, to avoid ambiguous-type errors when using string literal overloading.
getContentLanguage >>= maybe send415Error readRequestBodyWith . mapContentLanguage [ ("en-gb", parseBritishEnglish) , ("fr", parseFrench) ]
mapContentMedia :: [(MediaType, b)] -> ByteString -> Maybe bhttp-media Network.HTTP.Media A specialisation of mapContent that only takes MediaType as its input, to avoid ambiguous-type errors when using string literal overloading.
getContentType >>= maybe send415Error readRequestBodyWith . mapContentMedia [ ("application/json", parseJson) , ("text/plain", parseText) ]
mapQuality :: Accept a => [(a, b)] -> [Quality a] -> Maybe bhttp-media Network.HTTP.Media The equivalent of matchQuality above, except the resulting choice is mapped to another value. Convenient for specifying how to translate the resource into each of its available formats.
parseQuality header >>= maybe render406Error renderResource . mapQuality [ ("text" // "html", asHtml) , ("application" // "json", asJson) ]