freckle-app-1.11.0.0: Haskell application toolkit used at Freckle
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.HTTP.Link.Compat

Synopsis

Documentation

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

Construct a Link.

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

writeLink :: IsURI uri => Link uri -> Text Source #

parseLinkHeaderBS :: IsURI uri => ByteString -> Maybe [Link uri] Source #

Parses a Link header, returns a Maybe.

parseLinkHeaderBS' :: IsURI uri => ByteString -> Either String [Link uri] Source #

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] Source #

Parses a Link header, returns a Maybe.

parseLinkHeader' :: IsURI uri => Text -> Either String [Link uri] Source #

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] Source #

The Attoparsec parser for the Link header.

linkParams :: Link uri -> [(LinkParam, Text)] Source #

Extracts the parameters from the link.

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

Extracts the URI from the link.

data LinkParam Source #

The link attribute key.

Instances

Instances details
Show LinkParam 
Instance details

Defined in Network.HTTP.Link.Types

Eq LinkParam 
Instance details

Defined in Network.HTTP.Link.Types

class IsURI uri where Source #

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

Instances

Instances details
IsURI URI 
Instance details

Defined in Network.HTTP.Link.Types

IsURI Text 
Instance details

Defined in Network.HTTP.Link.Types