Module

URI.Common

Package
purescript-uri
Repository
slamdata/purescript-uri

Common functions used in parsing and printing URI components.

#URIPartParseError Source

newtype URIPartParseError

An error type used when a custom component parser fails to handle a value.

Constructors

Instances

#wrapParser Source

wrapParser :: forall b a m s. Monad m => (a -> Either URIPartParseError b) -> ParserT s m a -> ParserT s m b

Adapts a parser with a parser-esque function. First the original parser runs, then it attempts to refine the result with the function.

#alpha Source

alpha :: Parser String Char

Parser for ascii alphabetical characters (upper and lowercase).

#alphaNum Source

alphaNum :: Parser String Char

Parser for ascii alphanumeric characters (upper and lowercase for letters).

#unreserved Source

unreserved :: Parser String Char

Parser for characters that are allowed in a URI but do not have a reserved purpose.

#pctEncoded Source

pctEncoded :: Parser String NonEmptyString

Parser for a percent-encoded character.

#subDelims Source

subDelims :: Parser String Char

Parser for the "sub-delims" group of reserved characters.

#printEncoded Source

printEncoded :: Parser String Char -> String -> String

A helper function for printing URI components using percent-encoding for characters that require it.

Accepts a parser that is used to determine whether a character is allowed to appear un-encoded in the URI component and the string to encode.

#printEncoded' Source

printEncoded' :: Parser String Char -> NonEmptyString -> NonEmptyString

A version of printEncoded that operates on non-empty strings.

#decodeURIComponent' Source

decodeURIComponent' :: NonEmptyString -> NonEmptyString

A version of decodeURIComponent that operates on non-empty strings.