URI.HierarchicalPart
- Package
- purescript-uri
- Repository
- slamdata/purescript-uri
#HierarchicalPart Source
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
HierarchicalPartAuth (Authority userInfo hosts) path
HierarchicalPartNoAuth (Maybe hierPath)
Instances
(Eq userInfo, Eq hosts, Eq path, Eq hierPath) => Eq (HierarchicalPart userInfo hosts path hierPath)
(Ord userInfo, Ord hosts, Ord path, Ord hierPath) => Ord (HierarchicalPart userInfo hosts path hierPath)
Generic (HierarchicalPart userInfo hosts path hierPath) _
(Show userInfo, Show hosts, Show path, Show hierPath) => Show (HierarchicalPart userInfo hosts path hierPath)
#HierarchicalPartOptions Source
type 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.
#HierarchicalPartParseOptions Source
type 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.
#HierarchicalPartPrintOptions Source
type 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.
#HierPath Source
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.
#parser Source
parser :: forall r hierPath path hosts userInfo. Record (HierarchicalPartParseOptions userInfo hosts path hierPath r) -> Parser String (HierarchicalPart userInfo hosts path hierPath)
A parser for the hierarchical-part of a URI.
#print Source
print :: forall r hierPath path hosts userInfo. Record (HierarchicalPartPrintOptions userInfo hosts path hierPath r) -> HierarchicalPart userInfo hosts path hierPath -> String
A printer for the hierarchical-part of a URI.
#_authority Source
_authority :: forall hierPath path hosts userInfo. Traversal' (HierarchicalPart userInfo hosts path hierPath) (Authority userInfo hosts)
An affine traversal for the authority component of a hierarchical-part.
#_path Source
_path :: forall hierPath path hosts userInfo. 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.
#_hierPath Source
_hierPath :: forall hierPath path hosts userInfo. 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.
Re-exports from URI.Authority
#UserInfo Source
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
#IPv6Address Source
newtype IPv6Address
This type and parser are much too forgiving currently, allowing almost anything through that looks vaguely IPv6ish.
Instances
#IPv4Address Source
#Host Source
#AuthorityPrintOptions Source
type 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 Source
type 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 Source
type 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 Source
data Authority userInfo hosts
The authority part of a URI. For example: purescript.org
,
localhost:3000
, user@example.net
.
Constructors
Instances
#_IPv6Address Source
_IPv6Address :: Prism' Host IPv6Address
A prism for the IPv6Address
constructor.
#_IPv4Address Source
_IPv4Address :: Prism' Host IPv4Address
A prism for the IPv4Address
constructor.
Re-exports from URI.Path
#Path Source
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
Re-exports from URI.Path.Absolute
#PathAbsolute Source
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
Re-exports from URI.Path.Rootless
#PathRootless Source
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
- Modules
- URI
- URI.
AbsoluteURI - URI.
Authority - URI.
Common - URI.
Extra. MultiHostPortPair - URI.
Extra. QueryPairs - URI.
Extra. UserPassInfo - URI.
Fragment - URI.
HierarchicalPart - URI.
Host - URI.
Host. Gen - URI.
Host. IPv4Address - URI.
Host. IPv6Address - URI.
Host. RegName - URI.
HostPortPair - URI.
HostPortPair. Gen - URI.
Path - URI.
Path. Absolute - URI.
Path. NoScheme - URI.
Path. Rootless - URI.
Path. Segment - URI.
Port - URI.
Port. Gen - URI.
Query - URI.
RelativePart - URI.
RelativeRef - URI.
Scheme - URI.
Scheme. Common - URI.
URI - URI.
URIRef - URI.
UserInfo