-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | RFC-based International Resource Identifier library
--
-- This library provides a universal data model for representation of
-- both 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.
--
-- The data is represented in Unicode, and the API automates all the
-- encoding fuss.
@package iri
@version 0.3
module Iri.Rendering.TextBuilder
iri :: Iri -> Builder
httpIri :: HttpIri -> Builder
-- | References:
--
--
module Iri.Data
-- | Thorough structure of IRI.
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 :: Text -> User
data Password
PresentPassword :: !Text -> Password
MissingPassword :: Password
data Host
NamedHost :: !RegName -> Host
IpV4Host :: !IPv4 -> Host
IpV6Host :: !IPv6 -> Host
newtype RegName
RegName :: (Vector DomainLabel) -> RegName
newtype DomainLabel
DomainLabel :: Text -> DomainLabel
data Port
PresentPort :: !Word16 -> Port
MissingPort :: Port
newtype Path
Path :: (Vector PathSegment) -> Path
newtype PathSegment
PathSegment :: Text -> 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 a decoded Unicode string.
--
-- See https://en.wikipedia.org/wiki/Query_string.
newtype Query
Query :: Text -> Query
newtype Fragment
Fragment :: Text -> 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 IRI 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.Rendering.Text
-- | Render as a Unicode IRI text
iri :: Iri -> Text
-- | Render as a Unicode IRI text
httpIri :: HttpIri -> Text
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
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
module Iri.Parsing.Attoparsec.ByteString
-- | Parser of a well-formed URI conforming to the RFC3986 standard into
-- IRI. Performs URL- and Punycode-decoding.
uri :: Parser Iri
-- | Same as uri, but optimized specifially for the case of HTTP
-- URIs.
httpUri :: Parser HttpIri
module Iri.QuasiQuoter
-- | IRI literal parsed from textual URI.
uri :: QuasiQuoter
-- | HTTP IRI literal parsed from textual URI.
httpUri :: 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
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 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 Prism s t a b = forall p f. (Choice p, Applicative f) => p a (f b) -> p s (f t)
type Prism' s a = Prism s s a a
iriHttpIri :: Prism' Iri HttpIri
uriByteStringIri :: Prism' ByteString Iri
uriByteStringHttpIri :: Prism' ByteString HttpIri
iriTextIri :: Prism' Text Iri
iriTextHttpIri :: Prism' Text HttpIri
iriScheme :: Lens' Iri ByteString
iriHierarchy :: Lens' Iri Hierarchy
iriQuery :: Lens' Iri Text
iriFragment :: Lens' Iri Text