yesod-page-cursor-2.0.1.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.HTTP.Link.Compat

Synopsis

Documentation

lnk :: IsURI uri => String -> [(LinkParam, Text)] -> Maybe (Link uri) #

Construct a Link.

writeLinkHeader :: IsURI uri => [Link uri] -> Text #

writeLink :: 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 -> Maybe [Link uri] #

Parses a Link header, returns a Maybe.

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.

href :: IsURI uri => Link uri -> uri #

Extracts the URI from the link.

data LinkParam #

The link attribute key.

Instances

Instances details
Eq LinkParam 
Instance details

Defined in Network.HTTP.Link.Types

Show LinkParam 
Instance details

Defined in Network.HTTP.Link.Types

class IsURI uri where #

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

Methods

uriFromText :: Text -> Either String uri #

uriToText :: uri -> Text #

Instances

Instances details
IsURI Text 
Instance details

Defined in Network.HTTP.Link.Types

IsURI URI 
Instance details

Defined in Network.HTTP.Link.Types