Module

URI.AbsoluteURI

#AbsoluteURI

data AbsoluteURI userInfo hosts path hierPath query

A strictly absolute URI. An absolute URI can still contain relative paths but is required to have a Scheme component.

Constructors

Instances

#AbsoluteURIOptions

type AbsoluteURIOptions :: Type -> Type -> Type -> Type -> Type -> Row Typetype AbsoluteURIOptions userInfo hosts path hierPath query = AbsoluteURIParseOptions userInfo hosts path hierPath query (AbsoluteURIPrintOptions userInfo hosts path hierPath query ())

A row type for describing the options fields used by the absolute URI parser and printer.

Used as Record (AbsoluteURIOptions userInfo hosts path hierPath query) when type anotating an options record.

See below for details of how to use these configuration options.

#AbsoluteURIParseOptions

type AbsoluteURIParseOptions :: Type -> Type -> Type -> Type -> Type -> Row Type -> Row Typetype AbsoluteURIParseOptions userInfo hosts path hierPath query r = (parseHierPath :: Either PathAbsolute PathRootless -> Either URIPartParseError hierPath, parseHosts :: Parser String hosts, parsePath :: Path -> Either URIPartParseError path, parseQuery :: Query -> Either URIPartParseError query, parseUserInfo :: UserInfo -> Either URIPartParseError userInfo | r)

A row type for describing the options fields used by the absolute URI parser.

Used as Record (AbsoluteURIParseOptions userInfo hosts path hierPath query ()) when type anotating an options record.

Having this options record allows custom representations to be used for the URI components. If this is not necessary, pure can be used for all the options aside from parseHosts, which will typically be HostPortPair.parseHosts pure pure. See URI.HostPortPair for more information on the host/port pair parser.

#AbsoluteURIPrintOptions

type AbsoluteURIPrintOptions :: Type -> Type -> Type -> Type -> Type -> Row Type -> Row Typetype AbsoluteURIPrintOptions userInfo hosts path hierPath query r = (printHierPath :: hierPath -> Either PathAbsolute PathRootless, printHosts :: hosts -> String, printPath :: path -> Path, printQuery :: query -> Query, printUserInfo :: userInfo -> UserInfo | r)

A row type for describing the options fields used by the absolute URI printer.

Used as Record (AbsoluteURIPrintOptions userInfo hosts path hierPath query ()) when type anotating an options record.

As a reverse of the parse options, this specifies how to print values back from custom representations. If this is not necessary, identity can be used for all the options aside from printHosts, which will typically be HostPortPair.printHosts identity identity. See URI.HostPortPair for more information on the host/port pair printer.

#parser

parser :: forall userInfo hosts path hierPath query r. Record (AbsoluteURIParseOptions userInfo hosts path hierPath query r) -> Parser String (AbsoluteURI userInfo hosts path hierPath query)

A parser for an absolute URI.

#print

print :: forall userInfo hosts path hierPath query r. Record (AbsoluteURIPrintOptions userInfo hosts path hierPath query r) -> AbsoluteURI userInfo hosts path hierPath query -> String

A printer for an absolute URI.

#_scheme

_scheme :: forall userInfo hosts path hierPath query. Lens' (AbsoluteURI userInfo hosts path hierPath query) Scheme

The scheme component of an absolute URI.

#_hierPart

_hierPart :: forall userInfo hosts path hierPath query. Lens' (AbsoluteURI userInfo hosts path hierPath query) (HierarchicalPart userInfo hosts path hierPath)

The hierarchical-part component of an absolute URI.

#_query

_query :: forall userInfo hosts path hierPath query. Lens' (AbsoluteURI userInfo hosts path hierPath query) (Maybe query)

The query component of an absolute URI.

Re-exports from URI.HierarchicalPart

#UserInfo

newtype UserInfo

The user info part of an Authority. For example: user, foo:bar.

This type treats the entire string as an undifferentiated blob, if you would like to specifically deal with the user:password format, take a look at URI.Extra.UserPassInfo.

Instances

#RegName

newtype RegName

The reg-name variation of the host part of a URI. A reg-name is probably more commonly referred to as just a host name or domain name (but it is actually a name, rather than an IP address).

Instances

#Port

newtype Port

The port component of a host in a URI.

Instances

#PathRootless

newtype PathRootless

A relative path, corresponding to path-rootless in the spec. This path cannot start with the character / or be entirely empty. This type can appear in a hierarchical-part when there is no authority component.

Constructors

Instances

#PathAbsolute

newtype PathAbsolute

An absolute path, corresponding to path-absolute in the spec. This path cannot represent the value // - it must either be /, or start with a segment that is not empty, for example: /something, /., /... This type can appear in both hierarchical-part and relative-parts to represent an absolute path when no authority component is present.

This restriction exists as a value begining with // at this point in the grammar must be an authority, attempting to decide whether a value is an authority or a path would be ambiguous if // paths were allowed. The // path means the same thing as / anyway!

Constructors

Instances

#Path

newtype Path

A generic absolute-or-empty path, used in both hierarchical-part and relative-parts when an authority component is present. Corresponds to path-abempty in the spec.

A path value of / corresponds to Path [""], an empty path is Path [].

Constructors

Instances

#IPv6Address

newtype IPv6Address

This type and parser are much too forgiving currently, allowing almost anything through that looks vaguely IPv6ish.

Instances

#IPv4Address

data IPv4Address

The IPv4 address variation of the host part of a URI.

Instances

#Host

data Host

A host address. Supports named addresses, IPv4, and IPv6.

Constructors

Instances

#HierarchicalPartPrintOptions

type HierarchicalPartPrintOptions :: Type -> Type -> Type -> Type -> Row Type -> Row Typetype HierarchicalPartPrintOptions userInfo hosts path hierPath r = (printHierPath :: hierPath -> HierPath, printHosts :: hosts -> String, printPath :: path -> Path, printUserInfo :: userInfo -> UserInfo | r)

A row type for describing the options fields used by the hierarchical-part printer.

Used as Record (HierarchicalPartPrintOptions userInfo hosts path hierPath ()) when type anotating an options record.

#HierarchicalPartParseOptions

type HierarchicalPartParseOptions :: Type -> Type -> Type -> Type -> Row Type -> Row Typetype HierarchicalPartParseOptions userInfo hosts path hierPath r = (parseHierPath :: HierPath -> Either URIPartParseError hierPath, parseHosts :: Parser String hosts, parsePath :: Path -> Either URIPartParseError path, parseUserInfo :: UserInfo -> Either URIPartParseError userInfo | r)

A row type for describing the options fields used by the hierarchical-part parser.

Used as Record (HierarchicalPartParseOptions userInfo hosts path hierPath ()) when type anotating an options record.

#HierarchicalPartOptions

type HierarchicalPartOptions :: Type -> Type -> Type -> Type -> Row Typetype HierarchicalPartOptions userInfo hosts path hierPath = HierarchicalPartParseOptions userInfo hosts path hierPath (HierarchicalPartPrintOptions userInfo hosts path hierPath ())

A row type for describing the options fields used by the hierarchical-part parser and printer.

Used as Record (HierarchicalPartOptions userInfo hosts path hierPath) when type anotating an options record.

#HierarchicalPart

data HierarchicalPart userInfo hosts path hierPath

The "hierarchical part" of a generic or absolute URI. This combines an authority (optional) with a path value.

When the authority is present a generic path representation can be used, otherwise there are some restrictions on the path construction to ensure no ambiguity in parsing (this is per the spec, not a restriction of the library).

Constructors

Instances

#HierPath

type HierPath = Either PathAbsolute PathRootless

The specific path types supported in a hierarchical-part when there is no authority present. See URI.Path.Absolute and URI.Path.Rootless for an explanation of these forms.

#AuthorityPrintOptions

type AuthorityPrintOptions :: Type -> Type -> Row Type -> Row Typetype AuthorityPrintOptions userInfo hosts r = (printHosts :: hosts -> String, printUserInfo :: userInfo -> UserInfo | r)

A row type for describing the options fields used by the authority printer.

Used as Record (AuthorityPrintOptions userInfo hosts ()) when type annotating an options record.

#AuthorityParseOptions

type AuthorityParseOptions :: Type -> Type -> Row Type -> Row Typetype AuthorityParseOptions userInfo hosts r = (parseHosts :: Parser String hosts, parseUserInfo :: UserInfo -> Either URIPartParseError userInfo | r)

A row type for describing the options fields used by the authority parser.

Used as Record (AuthorityParseOptions userInfo hosts ()) when type annotating an options record.

#AuthorityOptions

type AuthorityOptions :: Type -> Type -> Row Typetype AuthorityOptions userInfo hosts = AuthorityParseOptions userInfo hosts (AuthorityPrintOptions userInfo hosts ())

A row type for describing the options fields used by the authority parser and printer.

Used as Record (AuthorityOptions userInfo hosts) when type annotating an options record.

#Authority

data Authority userInfo hosts

The authority part of a URI. For example: purescript.org, localhost:3000, user@example.net.

Constructors

Instances

#_userInfo

_userInfo :: forall userInfo hosts. Lens' (Authority userInfo hosts) (Maybe userInfo)

A lens for the user-info component of the authority.

#_path

_path :: forall userInfo hosts path hierPath. Traversal' (HierarchicalPart userInfo hosts path hierPath) path

An affine traversal for the path component of a hierarchical-part, this succeeds when the authority is present also.

#_hosts

_hosts :: forall userInfo hosts. Lens' (Authority userInfo hosts) hosts

A lens for the host(s) component of the authority.

#_hierPath

_hierPath :: forall userInfo hosts path hierPath. Traversal' (HierarchicalPart userInfo hosts path hierPath) (Maybe hierPath)

An affine traversal for the path component of a hierarchical-part, this succeeds when the authority is not present.

#_authority

_authority :: forall userInfo hosts path hierPath. Traversal' (HierarchicalPart userInfo hosts path hierPath) (Authority userInfo hosts)

An affine traversal for the authority component of a hierarchical-part.

#_NameAddress

_NameAddress :: Prism' Host RegName

A prism for the NameAddress constructor.

#_IPv6Address

_IPv6Address :: Prism' Host IPv6Address

A prism for the IPv6Address constructor.

#_IPv4Address

_IPv4Address :: Prism' Host IPv4Address

A prism for the IPv4Address constructor.

Re-exports from URI.Query

#Query

newtype Query

The query component of a URI.

This type treats the entire string as an undifferentiated blob, if you would like to deal with the common ?key1=value1&key2=value2 format, take a look at URI.Extra.QueryPairs.

Instances

Re-exports from URI.Scheme

#Scheme

newtype Scheme

The scheme part of an absolute URI. For example: http, ftp, git.

Instances

Modules