úÎ0E-ç$      !"# Safe-Infered )Class for parsing URL-related datatypes. 3Class for encoding items from this module as URLs. URL "C...refers to the subset of URIs that, in addition to identifying a N resource, provide a means of locating the resource by describing its ! primary access mechanism". 4A breakdown of URLs, per the diagram from RFC 3986:  8 foo://example.com:8042/over/there?name=ferret#nose 8 \_/ \______________/\_________/ \_________/ \__/ 7 | | | | | ; scheme authority path query fragment # | _____________________|__ $ / \ / \ $ urn:example:animal:ferret:nose GFor the most part, URL parts are made of strings with percent encoding K required of certain characters. The scheme is especially limited in the  allowable data:  ; scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) /Note well that no percent encoding is allowed. *The authority section, nominally denoting userinfo@ host:port, is in G fact quite flexible, allowing percent encoding for the hostname and L userinfo section; only the port has a byte range restriction, to digits. #Since this datatype represents the data! in a URL and not its particular  encoded form, we use $ liberally.  2 *( unreserved / pct-encoded / sub-delims / ":" )  , *( unreserved / pct-encoded / sub-delims ) JPaths are quite sophisticated, with 5 productions to handle the different F URI contexts in which they appear. However, for the purpose of URL M parsing, we can assume that paths are always separated from the authority % (even the empty authority) with a /% and thus can work with a relatively 0 simple subset of the productions in the RFC.  . path-rootless = segment-nz *( "/" segment )   ...   segment-nz = 1*pchar   ...  D pchar = unreserved / pct-encoded / sub-delims / ":" / "@" EAlthough literal slash runs are not permitted by the RFC, equivalent / content can be encoded with percent encoding. !To parse the authority and path: A we parse an authority and then optionally a slash and a path or 5 we parse a single slash and then optionally a path. JParse a bytestream, accepting either literal bytes matching the predicate & or any percent encoded characters. 1Transform any octet to its percent encoded form. Percent encode a $,, ignoring octets that match the predicate. !JSlash runs are not allowed in encoded paths. Here, this is interpreted to L mean that the first slash in path data, which would come after the slash G separating the path and the scheme or authority, should be escaped. -  !"#%&'()*+,-$  !"#$   !"#    !"#%&'()*+,-.       !"#$%&'()*+,-./ URLb-0.0.1 Network.URLbParseparserEncodeencodeScheme AuthorityuserinfohostportURLscheme authoritypathqueryfragment userinfoOctet userinfoP regNameOctetregNamePpercent pathRootlessP segmentOctet authorityPathqueryFragmentOctetqueryFragmentP usingOnly withPercents percentEncodeselectiveEncodeconcatNonEmpty pathEncode fromString' fromRightbytestring-0.9.2.1Data.ByteString.Internal ByteString $fParseScheme$fEncodeScheme$fIsStringScheme$fEncodeAuthority$fParseAuthority$fIsStringAuthority $fEncodeURL $fParseURL $fIsStringURL