iri-0.3: RFC-based International Resource Identifier library

Safe HaskellNone
LanguageHaskell2010

Iri.Data

Contents

Description

References:

Synopsis

Documentation

data Iri Source #

Thorough structure of IRI.

Constructors

Iri !Scheme !Hierarchy !Query !Fragment 

newtype Scheme Source #

Constructors

Scheme ByteString 

newtype User Source #

Constructors

User Text 

newtype RegName Source #

Constructors

RegName (Vector DomainLabel) 

newtype DomainLabel Source #

Constructors

DomainLabel Text 

newtype Path Source #

Constructors

Path (Vector PathSegment) 

newtype PathSegment Source #

Constructors

PathSegment Text 

newtype Query 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.

See https://en.wikipedia.org/wiki/Query_string.

Constructors

Query Text 

newtype Fragment Source #

Constructors

Fragment Text 

Special cases

HTTP special case

data HttpIri Source #

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

newtype Security Source #

Constructors

Security Bool 

httpIriFromIri :: Iri -> Either Text HttpIri Source #

Try to specialize a general IRI to HTTP

iriFromHttpIri :: HttpIri -> Iri Source #

Generalize an HTTP IRI to IRI