Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type Link = Link URI
- linkURI :: URI -> [(LinkParam, Text)] -> Link
- parseLinkURI :: Text -> Either String [Link]
- lnk :: IsURI uri => String -> [(LinkParam, Text)] -> Maybe (Link uri)
- writeLinkHeader :: IsURI uri => [Link uri] -> Text
- writeLink :: IsURI uri => Link uri -> Text
- parseLinkHeaderBS :: IsURI uri => ByteString -> Maybe [Link uri]
- parseLinkHeaderBS' :: IsURI uri => ByteString -> Either String [Link uri]
- parseLinkHeader :: IsURI uri => Text -> Maybe [Link uri]
- parseLinkHeader' :: IsURI uri => Text -> Either String [Link uri]
- linkHeader :: IsURI uri => Parser [Link uri]
- linkParams :: Link uri -> [(LinkParam, Text)]
- href :: IsURI uri => Link uri -> uri
- data LinkParam
- class IsURI uri where
Documentation
writeLinkHeader :: IsURI uri => [Link uri] -> Text #
parseLinkHeaderBS :: IsURI uri => ByteString -> Maybe [Link uri] #
Parses a Link header, returns a Maybe.
parseLinkHeaderBS' :: IsURI uri => ByteString -> Either String [Link uri] #
Parses a Link header, returns an Either, where Left is the Attoparsec error string (probably not a useful one).
parseLinkHeader' :: IsURI uri => Text -> Either String [Link uri] #
Parses a Link header, returns an Either, where Left is the Attoparsec error string (probably not a useful one).
linkHeader :: IsURI uri => Parser [Link uri] #
The Attoparsec parser for the Link header.
linkParams :: Link uri -> [(LinkParam, Text)] #
Extracts the parameters from the link.
The link attribute key.
Types that can represent URLs.
For example, to parse links containing Text.URI.URI
from the
modern-uri
package, simply define the orphan instance:
instance IsURI Modern.URI where uriFromText = left displayException . mkURI uriToText = render
Since: http-link-header-1.1.0