Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Iri = Iri !Scheme !Hierarchy !Query !Fragment
- newtype Scheme = Scheme ByteString
- data Hierarchy
- data Authority = Authority !UserInfo !Host !Port
- data UserInfo
- newtype User = User Text
- data Password
- data Host
- newtype RegName = RegName (Vector DomainLabel)
- newtype DomainLabel = DomainLabel Text
- data Port
- newtype Path = Path (Vector PathSegment)
- newtype PathSegment = PathSegment Text
- newtype Query = Query Text
- newtype Fragment = Fragment Text
- data HttpIri = HttpIri !Security !Host !Port !Path !Query !Fragment
- newtype Security = Security Bool
- httpIriFromIri :: Iri -> Either Text HttpIri
- iriFromHttpIri :: HttpIri -> Iri
Documentation
newtype DomainLabel Source #
newtype PathSegment Source #
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.
Special cases
HTTP special case
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
iriFromHttpIri :: HttpIri -> Iri Source #
Generalize an HTTP IRI to IRI