uri-0.1.6: Library for working with URIs

Text.URI

Synopsis

Documentation

data URI Source

Represents a general universal resource identifier using its component parts.

For example, for the URI

   foo://anonymous@www.haskell.org:42/ghc?query#frag

the components are:

Constructors

URI 

Instances

dereferencePath :: [String] -> [String]Source

Removes .. and . from path

dereferencePathString :: String -> StringSource

dereferencePath for strings

escapeString :: (Char -> Bool) -> String -> StringSource

Escapes string, using predicate to determine whether character is allowed

isReference :: URI -> BoolSource

Checks if uri is a reference

isRelative :: URI -> BoolSource

Checks if uri is relative

nullURI :: URISource

Blank URI

okInFragment :: Char -> BoolSource

Checks if character is OK in fragment

okInPath :: Char -> BoolSource

Checks if character is OK in path

okInQuery :: Char -> BoolSource

Checks if character is OK in query

okInQueryItem :: Char -> BoolSource

Checks if character is OK in urlencoded query item

okInUserinfo :: Char -> BoolSource

Checks if character is OK in userinfo

mergePaths :: [String] -> [String] -> [String]Source

Merges two paths

mergePathStrings :: String -> String -> StringSource

mergePaths for strings

mergeURIsSource

Arguments

:: URI

Base URI

-> URI

Reference URI

-> URI

Resulting URI

Merges two URIs

mergeURIStrings :: String -> String -> StringSource

mergeURIs for strings

pairsToQuery :: [(String, String)] -> StringSource

Composes www-urlencoded query from key-value pairs

parseURI :: String -> Maybe URISource

Parses URI

pathToSegments :: String -> [String]Source

Splits path to segments

segmentsToPath :: [String] -> StringSource

Joins path segments, with escaping

queryToPairs :: String -> [(String, String)]Source

Parses www-urlencoded string to key-value pairs

unescapeString :: String -> StringSource

Unescapes percent-sequences

uriPathSegments :: URI -> [String]Source

Convenience function for extracting path segments

uriQueryItems :: URI -> [(String, String)]Source

Convenience function for extracting www-urlencoded data