-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A parser and writer for the HTTP Link header per RFC 5988 -- -- Please see the README on GitHub at -- https://github.com/myfreeweb/http-link-header#readme @package http-link-header @version 1.1.1 -- | The data type definitions for the HTTP Link header. module Network.HTTP.Link.Types -- | The link attribute key. data LinkParam Rel :: LinkParam Anchor :: LinkParam Rev :: LinkParam Hreflang :: LinkParam Media :: LinkParam Title :: LinkParam Title' :: LinkParam ContentType :: LinkParam Other :: Text -> LinkParam -- | A single link containing some representation of a URL. data GLink uri Link :: uri -> [(LinkParam, Text)] -> GLink uri -- | Types that can represent URLs. -- -- For example, to parse links containing @Text.URI.URI@ from the -- @modern-uri@ package, simply define: -- --
--   instance IsURI Modern.URI where
--       uriFromText = left displayException . mkURI
--   
class IsURI uri uriFromText :: IsURI uri => Text -> Either String uri -- | A single link containing a network-uri URI. Most of this library is -- specialized to this case. type Link = GLink URI -- | Extracts the URI from the link. href :: Link -> URI -- | Extracts the parameters from the link. linkParams :: Link -> [(LinkParam, Text)] lnk :: String -> [(LinkParam, Text)] -> Maybe Link instance GHC.Show.Show uri => GHC.Show.Show (Network.HTTP.Link.Types.GLink uri) instance GHC.Classes.Eq uri => GHC.Classes.Eq (Network.HTTP.Link.Types.GLink uri) instance GHC.Show.Show Network.HTTP.Link.Types.LinkParam instance GHC.Classes.Eq Network.HTTP.Link.Types.LinkParam instance Network.HTTP.Link.Types.IsURI Network.URI.URI instance Network.HTTP.Link.Types.IsURI Data.Text.Internal.Text -- | The parser for the HTTP Link header as defined in RFC 5988. More -- liberal than the RFC though: does not validate URLs and other deep -- stuff, accepts whitespace in weird places. module Network.HTTP.Link.Parser -- | The Attoparsec parser for the Link header. linkHeader :: Parser [Link] -- | Parses a Link header, returns an Either, where Left is the Attoparsec -- error string (probably not a useful one). parseLinkHeader' :: Text -> Either String [Link] -- | Parses a Link header, returns a Maybe. parseLinkHeader :: Text -> Maybe [Link] -- | Parses a Link header, returns an Either, where Left is the Attoparsec -- error string (probably not a useful one). parseLinkHeaderBS' :: ByteString -> Either String [Link] -- | Parses a Link header, returns a Maybe. parseLinkHeaderBS :: ByteString -> Maybe [Link] -- | Parses a GLink header, returns an Either, where Left is the Attoparsec -- error string (probably not a useful one). parseGLinkHeader' :: IsURI uri => Text -> Either String [GLink uri] -- | Parses a GLink header, returns a Maybe. parseGLinkHeader :: IsURI uri => Text -> Maybe [GLink uri] -- | Parses a GLink header, returns an Either, where Left is the Attoparsec -- error string (probably not a useful one). parseGLinkHeaderBS' :: IsURI uri => ByteString -> Either String [GLink uri] -- | Parses a GLink header, returns a Maybe. parseGLinkHeaderBS :: IsURI uri => ByteString -> Maybe [GLink uri] module Network.HTTP.Link.Writer writeLink :: Link -> Text writeLinkHeader :: [Link] -> Text -- | This module exports all the things at the same time. module Network.HTTP.Link instance Web.Internal.HttpApiData.ToHttpApiData [Network.HTTP.Link.Types.Link] instance Web.Internal.HttpApiData.ToHttpApiData Network.HTTP.Link.Types.Link