-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | RFC-based resource identifier library
--
-- This library provides a universal data model for representation of
-- URI, URL and IRI. It comes packed with parsing, rendering and
-- serialisation functionality. It is implemented in conformance with the
-- RFC-3986 and RFC-3987 specifications and is intended as a standard
-- tool for all tasks related to resource identifiers.
@package iri
@version 0.5
module Iri.Rendering.TextBuilder
iri :: Iri -> Builder
httpIri :: HttpIri -> Builder
module Iri.Rendering.Text
-- | Render as a Unicode IRI text
iri :: Iri -> Text
-- | Render as a Unicode IRI text
httpIri :: HttpIri -> Text
-- |
module Iri.Data
-- | Thorough structure of IRI or URI.
data Iri
Iri :: !Scheme -> !Hierarchy -> !Query -> !Fragment -> Iri
newtype Scheme
Scheme :: ByteString -> Scheme
data Hierarchy
AuthorisedHierarchy :: !Authority -> !Path -> Hierarchy
AbsoluteHierarchy :: !Path -> Hierarchy
RelativeHierarchy :: !Path -> Hierarchy
data Authority
Authority :: !UserInfo -> !Host -> !Port -> Authority
data UserInfo
PresentUserInfo :: !User -> !Password -> UserInfo
MissingUserInfo :: UserInfo
newtype User
User :: ByteString -> User
data Password
PresentPassword :: !ByteString -> Password
MissingPassword :: Password
data Host
NamedHost :: !RegName -> Host
IpV4Host :: !IPv4 -> Host
IpV6Host :: !IPv6 -> Host
newtype RegName
RegName :: Vector DomainLabel -> RegName
data DomainLabel
DomainLabel :: Text -> DomainLabel
data Port
PresentPort :: !Word16 -> Port
MissingPort :: Port
newtype Path
Path :: Vector PathSegment -> Path
newtype PathSegment
PathSegment :: ByteString -> PathSegment
-- | Since the exact structure of the query string is not standardised and
-- methods used to parse the query string may differ between websites, we
-- simply represent it as percent-decoded bytes.
--
-- See https://en.wikipedia.org/wiki/Query_string.
newtype Query
Query :: ByteString -> Query
newtype Fragment
Fragment :: ByteString -> Fragment
-- | HTTP being by far the most common use-case for resource identifiers,
-- it's been isolated into a dedicated data-type, which is optimised for
-- that particular case.
--
-- Compared to the general URI definition it:
--
--
-- - only supports the HTTP and HTTPS schemes
-- - misses the Username and Password components
-- - requires the Host component
-- - requires the Path component to be absolute
--
data HttpIri
HttpIri :: !Security -> !Host -> !Port -> !Path -> !Query -> !Fragment -> HttpIri
newtype Security
Security :: Bool -> Security
-- | Try to specialize a general IRI to HTTP
httpIriFromIri :: Iri -> Either Text HttpIri
-- | Generalize an HTTP IRI to IRI
iriFromHttpIri :: HttpIri -> Iri
module Iri.Parsing.Attoparsec.Text
-- | Parser of a well-formed IRI conforming to the RFC3987 standard into
-- Iri. Performs URL-decoding.
iri :: Parser Iri
-- | Same as iri, but optimized specifially for the case of HTTP
-- IRIs.
httpIri :: Parser HttpIri
hierarchy :: Parser Hierarchy
scheme :: Parser Scheme
host :: Parser Host
regName :: Parser RegName
-- | Domain label with Punycode decoding applied.
domainLabel :: Parser DomainLabel
port :: Parser Word16
path :: Parser Path
pathSegment :: Parser PathSegment
query :: Parser Query
fragment :: Parser Fragment
module Iri.Parsing.Text
-- | Parser of a well-formed IRI conforming to the RFC3987 standard into
-- Iri. Performs URL-decoding.
iri :: Text -> Either Text Iri
-- | Same as iri, but optimized specifially for the case of HTTP
-- IRIs.
httpIri :: Text -> Either Text HttpIri
hierarchy :: Text -> Either Text Hierarchy
scheme :: Text -> Either Text Scheme
host :: Text -> Either Text Host
regName :: Text -> Either Text RegName
domainLabel :: Text -> Either Text DomainLabel
port :: Text -> Either Text Word16
path :: Text -> Either Text Path
pathSegment :: Text -> Either Text PathSegment
query :: Text -> Either Text Query
fragment :: Text -> Either Text Fragment
module Iri.Parsing.Attoparsec.ByteString
-- | Parser of a well-formed URI conforming to the RFC3986 or RFC3987
-- standards. Performs URL- and Punycode-decoding.
uri :: Parser Iri
-- | Same as uri, but optimized specifially for the case of HTTP
-- URIs.
httpUri :: Parser HttpIri
regName :: Parser RegName
module Iri.QuasiQuoter
-- | Iri literal from ASCII representation.
uri :: QuasiQuoter
-- | HttpIri literal from ASCII representation.
httpUri :: QuasiQuoter
-- | Iri literal from IRI representation.
iri :: QuasiQuoter
-- | HttpIri literal from IRI representation.
httpIri :: QuasiQuoter
module Iri.Parsing.ByteString
-- | Parser of a well-formed URI conforming to the RFC3986 standard into
-- IRI. Performs URL- and Punycode-decoding.
uri :: ByteString -> Either Text Iri
-- | Same as uri, but optimized specifially for the case of HTTP
-- URIs.
httpUri :: ByteString -> Either Text HttpIri
-- | Domain name parser.
regName :: ByteString -> Either Text RegName
-- | Assuming we have a valid URI as input, extract the query part from it.
uriQuery :: ByteString -> Either Text Query
module Iri.Rendering.Ptr.Poking
uri :: Iri -> Poking
httpUri :: HttpIri -> Poking
scheme :: Scheme -> Poking
host :: Host -> Poking
path :: Path -> Poking
query :: Query -> Poking
module Iri.Rendering.ByteString
-- | Render as URI ASCII bytes
uri :: Iri -> ByteString
-- | Render as URI ASCII bytes
httpUri :: HttpIri -> ByteString
-- | These are the beginnings of a Lens API. It is compatible with the
-- general Van Laarhoven lens libraries, such as "lens".
--
-- Many more definitions can be implemented, so do PRs if you miss any!
module Iri.Optics
type Prism' s a = Prism s s a a
type Prism s t a b = forall p f. (Choice p, Applicative f) => p a (f b) -> p s (f t)
type Lens s t a b = forall f. (Functor f) => (a -> f b) -> s -> f t
type Lens' s a = Lens s s a a
type Traversal s t a b = forall f. (Applicative f) => (a -> f b) -> s -> f t
type Traversal' s a = Traversal s s a a
textIriIri :: Prism' Text Iri
textIriHttpIri :: Prism' Text HttpIri
byteStringIri :: Prism' ByteString Iri
byteStringHttpIri :: Prism' ByteString HttpIri
byteStringTextInUtf8 :: Prism' ByteString Text
iriHttpIri :: Prism' Iri HttpIri
iriScheme :: Lens' Iri Scheme
iriHierarchy :: Lens' Iri Hierarchy
iriQuery :: Lens' Iri Query
iriFragment :: Lens' Iri Fragment
schemeByteString :: Lens' Scheme ByteString
fragmentByteString :: Lens' Fragment ByteString